@CalledByNative private void onVideoSizeChanged(int width, int height) { mVideoWidth = width; mVideoHeight = height; // This will trigger the SurfaceView.onMeasure() call. mVideoSurfaceView.getHolder().setFixedSize(mVideoWidth, mVideoHeight); }
@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)); }
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(); }