Example #1
0
 @Override
 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
   mVideoSurfaceView.setFocusable(true);
   mVideoSurfaceView.setFocusableInTouchMode(true);
   if (isInPlaybackState() && mControls != null) {
     mControls.show();
   }
 }
 @CalledByNative
 private void onVideoSizeChanged(int width, int height) {
   mVideoWidth = width;
   mVideoHeight = height;
   // This will trigger the SurfaceView.onMeasure() call.
   mVideoSurfaceView.getHolder().setFixedSize(mVideoWidth, mVideoHeight);
 }
Example #3
0
 @CalledByNative
 private void onVideoSizeChanged(int width, int height) {
   mVideoWidth = width;
   mVideoHeight = height;
   if (mVideoWidth != 0 && mVideoHeight != 0) {
     mVideoSurfaceView.getHolder().setFixedSize(mVideoWidth, mVideoHeight);
   }
 }
  protected void showContentVideoView() {
    mVideoSurfaceView.getHolder().addCallback(this);
    this.addView(
        mVideoSurfaceView,
        new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT,
            Gravity.CENTER));

    mProgressView = mClient.getVideoLoadingProgressView();
    if (mProgressView == null) {
      mProgressView = new ProgressView(getContext(), mVideoLoadingText);
    }
    this.addView(
        mProgressView,
        new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT,
            Gravity.CENTER));
  }
Example #5
0
 private void showContentVideoView() {
   FrameLayout.LayoutParams layoutParams =
       new FrameLayout.LayoutParams(
           ViewGroup.LayoutParams.WRAP_CONTENT,
           ViewGroup.LayoutParams.WRAP_CONTENT,
           Gravity.CENTER);
   this.addView(mVideoSurfaceView, layoutParams);
   View progressView = mClient.getVideoLoadingProgressView();
   if (progressView != null) {
     mProgressView = progressView;
   } else {
     mProgressView = new ProgressView(getContext(), mVideoLoadingText);
   }
   this.addView(mProgressView, layoutParams);
   mVideoSurfaceView.setZOrderOnTop(true);
   mVideoSurfaceView.setOnKeyListener(this);
   mVideoSurfaceView.setOnTouchListener(this);
   mVideoSurfaceView.getHolder().addCallback(this);
   mVideoSurfaceView.setFocusable(true);
   mVideoSurfaceView.setFocusableInTouchMode(true);
   mVideoSurfaceView.requestFocus();
 }