Example #1
0
 private void attachControls() {
   if (mControls != null) {
     mControls.setDelegate(this);
     mControls.setAnchorView(mVideoSurfaceView);
     mControls.setEnabled(false);
   }
 }
Example #2
0
 private void removeControls() {
   if (mControls != null) {
     mControls.setEnabled(false);
     mControls.hide();
     mControls = null;
   }
 }
Example #3
0
  @CalledByNative
  private void onUpdateMediaMetadata(
      int videoWidth,
      int videoHeight,
      int duration,
      boolean canPause,
      boolean canSeekBack,
      boolean canSeekForward) {
    mProgressView.setVisibility(View.GONE);
    mDuration = duration;
    mCanPause = canPause;
    mCanSeekBack = canSeekBack;
    mCanSeekForward = canSeekForward;
    mCurrentState = isPlaying() ? STATE_PLAYING : STATE_PAUSED;
    if (mControls != null) {
      mControls.setEnabled(true);
      // If paused , should show the controller for ever.
      if (isPlaying()) mControls.show();
      else mControls.show(0);
    }

    onVideoSizeChanged(videoWidth, videoHeight);
  }