コード例 #1
0
  private final MovieAnimation doInitialize() {
    if (null != m_video) {
      setErrorHandler(this, m_video.getVideoElement());

      String url = getURL();

      if ((null == url) || ((url = url.trim()).isEmpty()) || (url.startsWith("#"))) {
        throw new NullPointerException("null or empty or invalid url");
      }
      url = UriUtils.fromString(url).asString();

      if ((null == url) || ((url = url.trim()).isEmpty()) || (url.startsWith("#"))) {
        throw new NullPointerException("null or empty or invalid url");
      }
      m_video.setSrc(url);

      m_video.setLoop(isLoop());

      m_video.setVisible(false);

      m_video.setPlaybackRate(getPlaybackRate());

      m_video.setPreload(MediaElement.PRELOAD_AUTO);

      if (getAttributes().isDefined(Attribute.VOLUME)) {
        m_video.setVolume(getVolume());
      }
      setSizes();

      return new MovieAnimation(this, m_video);
    } else {
      return null;
    }
  }
コード例 #2
0
  /**
   * Sets the movie's volume
   *
   * @param volume
   * @return this Movie
   */
  public Movie setVolume(double volume) {
    getAttributes().setVolume(volume);

    if (null != m_video) {
      m_video.setVolume(getVolume());
    }
    return this;
  }