Example #1
0
  /**
   * Requests the DefaultControls to become visible. This should only be called after {@link
   * #setDefaultControlsEnabled(boolean)}.
   */
  public void showDefaultControls() {
    if (defaultControls != null) {
      defaultControls.show();

      if (isPlaying()) {
        defaultControls.hideDelayed(DefaultControls.DEFAULT_CONTROL_HIDE_DELAY);
      }
    }
  }
Example #2
0
  /**
   * If a video is currently in playback then the playback will be suspended and and the
   * progressPoll will be stopped (see {@link #startProgressPoll()})
   */
  public void suspend() {
    if (!useExo) {
      videoView.suspend();
    } else {
      emExoPlayer.release();
    }

    if (defaultControls != null) {
      defaultControls.updatePlayPauseImage(false);
      defaultControls.show();
    }

    playRequested = false;
    stopProgressPoll();
  }
Example #3
0
  /**
   * If a video is currently in playback then the playback will be stopped and the progressPoll will
   * be stopped (see {@link #startProgressPoll()})
   */
  public void stopPlayback() {
    if (!useExo) {
      videoView.stopPlayback();
    } else {
      emExoPlayer.setPlayWhenReady(false);
    }

    if (defaultControls != null) {
      defaultControls.updatePlayPauseImage(false);
      defaultControls.show();
    }

    playRequested = false;
    stopProgressPoll();
  }