// This updates the time bar display (if necessary). It is called by
  // mProgressChecker and also from places where the time bar needs
  // to be updated immediately.
  private int setProgress() {
    mVideoPosition = mVideoView.getCurrentPosition();
    // If the video position is smaller than the starting point of trimming,
    // correct it.
    if (mVideoPosition < mTrimStartTime) {
      mVideoView.seekTo(mTrimStartTime);
      mVideoPosition = mTrimStartTime;
    }
    // If the position is bigger than the end point of trimming, show the
    // replay button and pause.
    if (mVideoPosition >= mTrimEndTime && mTrimEndTime > 0) {
      if (mVideoPosition > mTrimEndTime) {
        mVideoView.seekTo(mTrimEndTime);
        mVideoPosition = mTrimEndTime;
      }
      mController.showEnded();
      mVideoView.pause();
    }

    int duration = mVideoView.getDuration();
    if (duration > 0 && mTrimEndTime == 0) {
      mTrimEndTime = duration;
    }
    mController.setTimes(mVideoPosition, duration, mTrimStartTime, mTrimEndTime);
    // Enable save if there's modifications
    mSaveVideoTextView.setEnabled(isModified());
    return mVideoPosition;
  }
Ejemplo n.º 2
0
  // Start the game
  private void enterGame() {

    if (gameStatus == GAME_MENU) {
      gameStatus = GAME_GOGAME;
      showView(R.id.start, 0, 2);
      showLayout(R.id.main, R.id.start);

      // Show Tips animation
      AnimationDrawable animationDo;
      ImageView doImage = (ImageView) findViewById(R.id.ani_do);
      doImage.setBackgroundResource(R.drawable.animation_do);
      animationDo = (AnimationDrawable) doImage.getBackground();
      animationDo.start();

      AnimationDrawable animationNotDo;
      ImageView ndoImage = (ImageView) findViewById(R.id.ani_notdo);
      ndoImage.setBackgroundResource(R.drawable.animation_notdo);
      animationNotDo = (AnimationDrawable) ndoImage.getBackground();
      animationNotDo.start();

      showView(R.id.ani_do, 600, 4);
      showView(R.id.ani_notdo, 600, 4);

      showView(R.id.text_do, 1000, 4);
      showView(R.id.text_notdo, 1000, 4);

      label01.setText("0");
      label02.setText("00:00");
      label03.setText(getString(R.string.highscore) + " " + Integer.toString(mHighScore));

      VideoView videoView = (VideoView) findViewById(R.id.videoView);
      videoView.pause();
    }
  }
Ejemplo n.º 3
0
 // Cuando se pausa, se llama al listener.
 @Override
 public void pause() {
   super.pause();
   if (mListener != null) {
     mListener.onVideoPause();
   }
 }
Ejemplo n.º 4
0
        @Override
        public void onReceive(final Context context, final Intent intent) {

          if (intent.getAction().equals(VideoConst.SEND_HOSTDP_TO_VIDEOPLAYER)) {
            String mVideoAction = intent.getStringExtra(VideoConst.EXTRA_NAME);

            if (mVideoAction.equals(VideoConst.EXTRA_VALUE_VIDEO_PLAYER_PLAY)) {

              mVideoView.start();
            } else if (mVideoAction.equals(VideoConst.EXTRA_VALUE_VIDEO_PLAYER_STOP)) {
              mVideoView.stopPlayback();
              finish();
            } else if (mVideoAction.equals(VideoConst.EXTRA_VALUE_VIDEO_PLAYER_PAUSE)) {

              mVideoView.pause();
            } else if (mVideoAction.equals(VideoConst.EXTRA_VALUE_VIDEO_PLAYER_RESUME)) {

              mVideoView.resume();
              mVideoView.start();
            } else if (mVideoAction.equals(VideoConst.EXTRA_VALUE_VIDEO_PLAYER_SEEK)) {
              int pos = intent.getIntExtra("pos", -1);
              mVideoView.seekTo(pos);
            }
          }
        }
Ejemplo n.º 5
0
 public void pauseVideo() {
   if (mVideoView != null) {
     if (LOCAL_LOGV) {
       Log.v(TAG, "Pausing video playback.");
     }
     mVideoView.pause();
   }
 }
 public void setUserVisibleHint(boolean isVisibleToUser) {
   super.setUserVisibleHint(isVisibleToUser);
   if (this.isVisible()) {
     if (!isVisibleToUser) // If we are becoming invisible, then...
     {
       videoView.pause();
     }
   }
 }
Ejemplo n.º 7
0
  @Override
  public void onPause() {
    super.onPause();

    videoView.pause();

    if (wifiLock != null && wifiLock.isHeld()) {
      wifiLock.release();
    }
  }
Ejemplo n.º 8
0
 // video 상태 변경
 private void statVideoSet(int stat) {
   if (stat == 0) {
     mVideoView.pause();
     mProgressHandler2.sendEmptyMessageDelayed(0, 0);
     viewSwitchSet(0);
   } else {
     mVideoView.start();
     mProgressHandler2.sendEmptyMessageDelayed(0, 100);
     viewSwitchSet(1);
   }
 }
Ejemplo n.º 9
0
  // SeekBar의 터치 시작
  @Override
  public void onStartTrackingTouch(SeekBar seekBar) {
    try {
      if (mStat == 0) {
        mMediaPlayer.pause();
      } else {
        mVideoView.pause();
      }

      //            Toast.makeText(getApplicationContext(), "터치시작", Toast.LENGTH_SHORT).show();
    } catch (Exception e) {

    }
  }
  @Override
  protected void onPause() {
    super.onPause();

    if (notificationState == false) {
      if (checkNote == false) {
        mNotificationManager.notify(120, notification);
        checkResume = 1;
      }
      seekPosition = vRadioView.getCurrentPosition();
      vRadioView.pause();
      resumeState = 1;
    } else {
      notificationState = false;
    }
  }
Ejemplo n.º 11
0
  private void playerAudio() {
    if (mMediaPlayer != null) {
      if (mAudioStat == 0) {
        // 현 상태가 멈춤이면 상태값을 플레이로
        mAudioStat = 1;
        statAudioSet(mAudioStat);

        mVideoStat = 0;
        mVideoView.pause();
        mProgressHandler.sendEmptyMessageDelayed(0, 0);
      } else {
        // 현 상태가 플레이면 멈춤을 하고 상태값 멈춤으로 변경
        mAudioStat = 0;
        statAudioSet(mAudioStat);
      }
      Log.d(TAG, "mAudioStat : " + mAudioStat);
    }
  }
  /** Implementation of OnPlayPauseClickedListener */
  public void onFragmentPlayPause(Movie movie, int position, Boolean playPause) {
    mVideoView.setVideoPath(movie.getVideoUrl());

    if (position == 0 || mPlaybackState == LeanbackPlaybackState.IDLE) {
      setupCallbacks();
      mPlaybackState = LeanbackPlaybackState.IDLE;
    }

    if (playPause && mPlaybackState != LeanbackPlaybackState.PLAYING) {
      mPlaybackState = LeanbackPlaybackState.PLAYING;
      if (position > 0) {
        mVideoView.seekTo(position);
        mVideoView.start();
      }
    } else {
      mPlaybackState = LeanbackPlaybackState.PAUSED;
      mVideoView.pause();
    }
    updatePlaybackState(position);
    updateMetadata(movie);
  }
Ejemplo n.º 13
0
 public void pause() {
   super.pause();
   for (Iterator iterator = listeners.iterator();
       iterator.hasNext();
       ((PlaybackListener) iterator.next()).pause()) {}
 }
Ejemplo n.º 14
0
 protected void onPause() {
   m.pause();
   i.setControlsState(cuv.c);
   super.onPause();
 }
Ejemplo n.º 15
0
 @Override
 protected void onPause() {
   stopProgressChecker();
   mSeekerPositionOnPause = mVideoView.getCurrentPosition();
   mVideoView.pause();
 }
Ejemplo n.º 16
0
 @Override
 public void onPause() {
   super.onPause();
   position = myVideoView.getCurrentPosition();
   myVideoView.pause();
 }
Ejemplo n.º 17
0
 public void onStop() {
   super.onStop();
   video.pause();
 }
Ejemplo n.º 18
0
 public void onPause() {
   super.onPause();
   video.pause();
 }
 private void pauseVideo() {
   mVideoView.pause();
   mController.showPaused();
 }
Ejemplo n.º 20
0
 private void stopVideo() {
   if (mAfternoonVideo != null) mAfternoonVideo.pause();
 }