Esempio n. 1
0
 @Override
 public void showLogger(boolean show) {
   engine.showLogger(show);
 }
Esempio n. 2
0
 @Override
 public boolean isResizeToVideoSize() {
   return engine.isResizeToVideoSize();
 }
Esempio n. 3
0
 @Override
 public void setResizeToVideoSize(boolean resize) {
   engine.setResizeToVideoSize(resize);
 }
Esempio n. 4
0
 @Override
 public void setRepeatMode(RepeatMode mode) {
   engine.setRepeatMode(mode);
 }
Esempio n. 5
0
 @Override
 public double getPlayPosition() {
   return engine.getPlayPosition();
 }
Esempio n. 6
0
 @Override
 public <T extends ConfigValue> void setConfigParameter(ConfigParameter param, T value) {
   engine.setConfigParameter(param, value);
 }
Esempio n. 7
0
 @Override
 public void setConfigParameter(ConfigParameter param, String value) {
   engine.setConfigParameter(param, value);
 }
Esempio n. 8
0
 @Override
 public double getVolume() {
   return engine.getVolume();
 }
Esempio n. 9
0
 @Override
 public void setVolume(double volume) {
   engine.setVolume(volume);
 }
Esempio n. 10
0
 @Override
 public void playMedia() throws PlayException {
   engine.playMedia();
 }
Esempio n. 11
0
 @Override
 public void stopMedia() {
   engine.stopMedia();
 }
Esempio n. 12
0
 @Override
 public void pauseMedia() {
   engine.pauseMedia();
 }
Esempio n. 13
0
 @Override
 public void loadMedia(String mediaURL) throws LoadException {
   engine.loadMedia(mediaURL);
 }
Esempio n. 14
0
 @Override
 public void setPlayPosition(double position) {
   engine.setPlayPosition(position);
 }
Esempio n. 15
0
 @Override
 public double getRate() {
   return engine.getRate();
 }
Esempio n. 16
0
 /** Returns the remaining number of times this player loops playback before stopping. */
 @Override
 public int getLoopCount() {
   return engine.getLoopCount();
 }
Esempio n. 17
0
 @Override
 public RepeatMode getRepeatMode() {
   return engine.getRepeatMode();
 }
Esempio n. 18
0
 /** Sets the number of times the current media file should loop playback before stopping. */
 @Override
 public void setLoopCount(int loop) {
   engine.setLoopCount(loop);
 }
Esempio n. 19
0
 @Override
 public void setConfigParameter(ConfigParameter param, Number value) {
   engine.setConfigParameter(param, value);
 }
Esempio n. 20
0
 @Override
 public int getVideoHeight() {
   return engine.getVideoHeight();
 }
Esempio n. 21
0
 @Override
 public void setRate(double rate) {
   engine.setRate(rate);
 }
Esempio n. 22
0
 @Override
 public int getVideoWidth() {
   return engine.getVideoWidth();
 }
Esempio n. 23
0
  /**
   * Constructs <code>CustomVideoPlayer</code> with the specified {@code height} and {@code width}
   * using the specified {@code playerPlugin} to playback media located at {@code mediaURL}. Media
   * playback begins automatically if {@code autoplay} is {@code true}.
   *
   * @param playerPlugin the plugin to use for playback.
   * @param mediaURL the URL of the media to playback
   * @param autoplay {@code true} to start playing automatically, {@code false} otherwise
   * @param height the height of the player
   * @param width the width of the player.
   * @throws LoadException if an error occurs while loading the media.
   * @throws PluginVersionException if the required player plugin version is not installed on the
   *     client.
   * @throws PluginNotFoundException if the player plugin is not installed on the client.
   * @throws NullPointerException if {@code height} or {@code width} is {@code null}
   * @see Plugin
   * @see QuickTimePlayer
   * @see WinMediaPlayer
   * @see FlashMediaPlayer
   */
  public CustomVideoPlayer(
      Plugin playerPlugin, String mediaURL, boolean autoplay, String height, String width)
      throws PluginNotFoundException, PluginVersionException, LoadException {
    if (height == null) {
      throw new NullPointerException("height cannot be null");
    }
    if (width == null) {
      throw new NullPointerException("width cannot be null");
    }

    engine = PlayerUtil.getPlayer(playerPlugin, mediaURL, autoplay, height, "100%");
    engine.addDebugHandler(
        new DebugHandler() {

          @Override
          public void onDebug(DebugEvent event) {
            fireEvent(event);
          }
        });
    engine.addLoadingProgressHandler(
        new LoadingProgressHandler() {

          @Override
          public void onLoadingProgress(LoadingProgressEvent event) {
            fireEvent(event);
          }
        });
    engine.addMediaInfoHandler(
        new MediaInfoHandler() {

          @Override
          public void onMediaInfoAvailable(MediaInfoEvent event) {
            fireEvent(event);
          }
        });
    engine.addPlayStateHandler(
        new PlayStateHandler() {

          @Override
          public void onPlayStateChanged(PlayStateEvent event) {
            fireEvent(event);
          }
        });
    engine.addPlayerStateHandler(
        new PlayerStateHandler() {

          @Override
          public void onPlayerStateChanged(PlayerStateEvent event) {
            switch (event.getPlayerState()) {
              case DimensionChangedOnVideo:
                onVideoDimensionChanged(engine.getOffsetWidth(), engine.getOffsetHeight());
                break;
              default:
                fireEvent(event);
            }
          }
        });

    engine.setConfigParameter(ConfigParameter.WMPUIMode, WinMediaPlayer.UIMode.NONE);
    engine.setControllerVisible(false);
    engine.showLogger(false);

    controller = new SimplePanel();
    controller.setWidth("100%");

    FlowPanel hp = new FlowPanel();
    hp.add(engine);
    hp.add(controller);

    super.initWidget(hp);
    setWidth(width);
  }
Esempio n. 24
0
 @Override
 public long getMediaDuration() {
   return engine.getMediaDuration();
 }