예제 #1
0
 private void attachControls() {
   if (mControls != null) {
     mControls.setDelegate(this);
     mControls.setAnchorView(mVideoSurfaceView);
     mControls.setEnabled(false);
   }
 }
예제 #2
0
 private void removeControls() {
   if (mControls != null) {
     mControls.setEnabled(false);
     mControls.hide();
     mControls = null;
   }
 }
예제 #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);
  }