Пример #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 to continuously loop or not.
   *
   * @param loop
   * @return this Movie
   */
  public Movie setLoop(boolean loop) {
    getAttributes().setLoop(loop);

    if (null != m_video) {
      m_video.setLoop(loop);
    }
    return this;
  }