VideoView getCurrentPosition - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for VideoView getCurrentPosition method.

This code example shows how to use the following methods:getCurrentPosition, isPlaying, stopPlayback
This code example shows how to use the following methods:getCurrentPosition, getDuration, stopPlayback
    	super.onStart(); 
    } 
	@Override 
	public void onPause() { 
    	// Stop video when the activity is pause. 
    	mPositionWhenPaused = mVideoView.getCurrentPosition();
    	mVideoView.stopPlayback();
    	Log.d(TAG, "OnStop: mPositionWhenPaused = " + mPositionWhenPaused);
    	Log.d(TAG, "OnStop: getDuration  = " + mVideoView.getDuration());
 
    	super.onPause(); 
    } 
	@Override 
	public void onResume() { 
    	// Resume video player 
    	if(mPositionWhenPaused >= 0) {
    		mVideoView.seekTo(mPositionWhenPaused);
    		mPositionWhenPaused = -1;
    	} 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, getDuration, isPlaying, pause, seekTo
 
    // 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();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, getDuration, isPlaying, pause, seekTo
 
    // 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();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, isPlaying, stopPlayback
This code example shows how to use the following methods:getCurrentPosition, isPlaying, stopPlayback
    } 
 
    @Override 
    public void onPause() { 
        mHandler.removeCallbacksAndMessages(null);
        setBookmark(mVideoView.getCurrentPosition());
 
        mPositionWhenPaused = mVideoView.getCurrentPosition();
        mWasPlayingWhenPaused = mVideoView.isPlaying();
        mVideoView.stopPlayback();
 
        super.onPause(); 
    } 
 
    @Override 
    public void onResume() { 
        if (mPositionWhenPaused >= 0) {
            mVideoView.setVideoURI(mUri);
            mVideoView.seekTo(mPositionWhenPaused);
            if (mWasPlayingWhenPaused) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, getDuration, suspend
        } 
    } 
 
    public void onPause() { 
        mHandler.removeCallbacksAndMessages(null);
        setBookmark(mVideoView.getCurrentPosition(), mVideoView.getDuration());
 
        mVideoView.suspend();
    } 
 
    public void onResume() { 
        mVideoView.resume();
    } 
 
    public void onDestroy() { 
        mVideoView.stopPlayback();
    } 
 
    public boolean onError(MediaPlayer player, int arg1, int arg2) {
        mHandler.removeCallbacksAndMessages(null);
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, isPlaying, pause
		super.onResume(); 
		videoView.seekTo(savedLocation);
	} 
	public void onPause() { 
		super.onPause(); 
		savedLocation = videoView.getCurrentPosition();
		if (videoView.isPlaying()) {
			videoView.pause();
		} 
	} 
	 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, getDuration, stopPlayback
 
	@Override 
	public void onPause() 
	{ 
		// Stop video when the activity is pause. 
		mPositionWhenPaused = mVideoView.getCurrentPosition();
		mVideoView.stopPlayback();
		// CHECKSTYLE:OFF 
		Log.d(TAG, "OnStop: mPositionWhenPaused = " + mPositionWhenPaused);
		Log.d(TAG, "OnStop: getDuration  = " + mVideoView.getDuration());
		// CHECKSTYLE:ON 
		super.onPause(); 
	} 
 
	@Override 
	public void onStop() 
	{ 
 
		super.onStop(); 
	} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentPosition, isPlaying, stopPlayback

Related VideoView getCurrentPosition Questions & Answers: