VideoView isPlaying - 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 isPlaying method.

This code example shows how to use the following methods:isPlaying, start
	} 
	 
	//----------------------------------------------------------------// 
	public void startPlayback () { 
		 
		if ( mVideoView.isPlaying ()) {
 
			mVideoView.resume ();
		} else { 
 
			mVideoView.start ();
		} 
	} 
	 
	//----------------------------------------------------------------// 
	public void pausePlayback () { 
		 
		mVideoView.pause ();
	} 
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isPlaying
 
    Handler mHandler = new Handler();
 
    Runnable mPlayingChecker = new Runnable() {
        public void run() { 
            if (mVideoView.isPlaying()) { 
                mProgressView.setVisibility(View.GONE); 
            } else { 
                mHandler.postDelayed(mPlayingChecker, 250); 
            } 
        } 
    }; 
 
    public MovieViewControl(View rootView, Context context, Uri videoUri) {
        mContentResolver = context.getContentResolver();
        mVideoView = (VideoView) rootView.findViewById(R.id.surface_view);
        mProgressView = rootView.findViewById(R.id.progress_indicator);
 
        mUri = videoUri;
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:canSeekForward, getDuration, isPlaying, seekTo, start
              
       // Don't start until ready to play.  The arg of seekTo(arg) is the start point in 
       // milliseconds from the beginning. In this example we start playing 1/5 of 
       // the way through the video if the player can do forward seeks on the video. 
        
       if(videoPlayer.canSeekForward()) videoPlayer.seekTo(videoPlayer.getDuration()/5);
       videoPlayer.start();
       Log.i("IS PLAYING", Boolean.toString(videoPlayer.isPlaying()));
    } 
     
    /** This callback will be invoked when the file is finished playing */ 
    @Override 
    public void onCompletion(MediaPlayer  mp) {
       // Statements to be executed when the video finishes. 
       this.finish();	
    } 
     
    /**  Use screen touches to toggle the video between playing and paused. */ 
    @Override 
    public boolean onTouchEvent (MotionEvent ev){
6
CodeRank
Contextual code suggestions in your IDE  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:isPlaying, setMediaController, setVideoPath, start, stopPlayback
		this.layoutVideo = (LinearLayout) v.findViewById(R.id.layoutVideo);
		return v;
	}// onCreateView 
 
	public void stopPlayback() { 
		videoView.stopPlayback();
	}// stopPlayback 
 
	public void hide() { 
		layoutVideo.setVisibility(View.GONE);
	} // hide 
 
	public void update(ContentUnit content_unit) {
		if (this.contentUnit != null) {
			if (this.contentUnit.getParent() == null
					&& content_unit.getParent() != null) {
				this.stopPlayback();
			} else if (this.contentUnit.getAncestors() != null
					&& content_unit.getParent() == null) {
				this.stopPlayback();

5
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  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:getParent, setId, setLayoutParams, isPlaying, setVideoURI
		// inflator.inflate(R.layout.play_card_front_side_play_section_video, 
		// null); 
		// } 
		// videoView = (VideoView) 
		// activity.findViewById(R.id.playCardFrontSidePlaySectionVideoLayoutVideoViewId); 
		videoView = new VideoView(context);
		RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
				RelativeLayout.LayoutParams.MATCH_PARENT,
				RelativeLayout.LayoutParams.MATCH_PARENT);
		videoView.setLayoutParams(layoutParams);
		videoView.setId(index * 15000);
 
		if (videoView.isPlaying()) {
			videoView.stopPlayback();
			RelativeLayout videoViewParentLayout = (RelativeLayout) videoView
					.getParent();
			videoViewParentLayout.removeAllViews();
			videoViewParentLayout
					.addView(playCardFrontSidePlaySectionImageWithPlayButtonLayout);
		} 

5
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  Get Codota for Java

Related VideoView isPlaying Questions & Answers: