Exemplo n.º 1
0
 @SuppressLint("NewApi")
 private void showVideoControls() {
   videoOverlay.setVisibility(View.VISIBLE);
   butPlay.setVisibility(View.VISIBLE);
   final Animation animation = AnimationUtils.loadAnimation(this, R.anim.fade_in);
   if (animation != null) {
     videoOverlay.startAnimation(animation);
     butPlay.startAnimation(animation);
   }
   if (Build.VERSION.SDK_INT >= 14) {
     videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
   }
 }
Exemplo n.º 2
0
  @Override
  protected void setupGUI() {
    super.setupGUI();
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    videoOverlay = (LinearLayout) findViewById(R.id.overlay);
    videoview = (AspectRatioVideoView) findViewById(R.id.videoview);
    progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator);
    videoview.getHolder().addCallback(surfaceHolderCallback);
    videoview.setOnTouchListener(onVideoviewTouched);

    if (Build.VERSION.SDK_INT >= 16) {
      videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    }
    if (Build.VERSION.SDK_INT >= 14) {
      videoOverlay.setFitsSystemWindows(true);
    }

    setupVideoControlsToggler();
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }