Пример #1
0
  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));
  }
Пример #2
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();
 }