Пример #1
0
 @Override
 public void onStartTrackingTouch(SeekBar seekBar) {
   super.onStartTrackingTouch(seekBar);
   if (videoControlsToggler != null) {
     videoControlsToggler.cancel(true);
   }
 }
Пример #2
0
 @Override
 protected void onPause() {
   super.onPause();
   if (videoControlsToggler != null) {
     videoControlsToggler.cancel(true);
   }
   if (controller != null && controller.getStatus() == PlayerStatus.PLAYING) {
     controller.pause();
   }
 }
Пример #3
0
 @SuppressLint("NewApi")
 void setupVideoControlsToggler() {
   if (videoControlsToggler != null) {
     videoControlsToggler.cancel(true);
   }
   videoControlsToggler = new VideoControlsHider();
   if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
     videoControlsToggler.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
   } else {
     videoControlsToggler.execute();
   }
 }
Пример #4
0
        @Override
        public boolean onTouch(View v, MotionEvent event) {
          if (event.getAction() == MotionEvent.ACTION_DOWN) {
            if (videoControlsToggler != null) {
              videoControlsToggler.cancel(true);
            }
            toggleVideoControlsVisibility();
            if (videoControlsShowing) {
              setupVideoControlsToggler();
            }

            return true;
          } else {
            return false;
          }
        }