Best code examples for MediaPlayer start method (android.media.MediaPlayer.start)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MediaPlayer start method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

MediaPlayer start examples from Open Source projects
This code example shows how to use the following methods: start
		if(stream){
			if(player==null) return;
			if(bP)
				player.pause();
			else 
				player.start();
		}else if(streamID!=-1){
			if(bP){
				pool.pause(streamID);
			}else{ 
				pool.resume(streamID);
			} 
			bIsPlaying = !bP;
		} 
	} 
	 
	void setLoop(boolean bLp){
		if(stream){
			if(player!=null)
				player.setLooping(bLp);
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
     * android.media.MediaPlayer.OnPreparedListener#onPrepared(android.media 
     * .MediaPlayer) 
     */ 
    public void onPrepared(MediaPlayer mediaplayer) {
        if (mp != null) {
            mp.start();
        } 
    } 
 
    /* 
     * (non-Javadoc) 
     *  
     * @see 
     * android.media.MediaPlayer.OnCompletionListener#onCompletion(android.media 
     * .MediaPlayer) 
     */ 
    public void onCompletion(MediaPlayer mediaplayer) {
        Timer endSound = new Timer();
        endSound.schedule(new TimerTask() {
            public void run() { 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: start
	@Override 
	public void show() { 
		super.show(); 
		 
		if(isSound){
			mPlayer.start();
		} 
	} 
	 
	/** 
	 * 设置是否播放声音 
	 */ 
	public void setIsSound(boolean isSound) {
		this.isSound = isSound;
	} 
	 
	/** 
	 * 获取控件实例 
	 * @param context 
	 * @param text 提示消息 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: seekTo, setLooping, start
			mp.start();
			state = PLAYING;
		} 
		else if ( state == PENDING_LOOP )
		{ 
			mp.setLooping(true);
			mp.seekTo(0);
			mp.start();
			state = LOOPING;
		} 
		else 
		{ 
			state = PREPARED;
			mp.seekTo(0);
		} 
	} 
	 
	public void onCompletion(MediaPlayer mPlayer)
	{ 
		if (state != LOOPING)
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: start
         
        public void onPrepared(MediaPlayer mp) {
            mAudioSrvState = PLAYING;
            Time duration = new Time(mp.getDuration());
            Log.v(TAG, "Prepared mediaplayer for track of duration =["+duration+"]");
            mMediaPlayer.start();
        } 
         
        public void onBufferingUpdate(MediaPlayer mp, int percent) {
            Log.v(TAG, "Buffered additional=["+percent+"%]");
            mAudioSrvState = BUFFERING;
        } 
         
        public void onCompletion(MediaPlayer mp) {
            Log.i(TAG, "Completed playback");
            mMediaPlayer.stop();
            mMediaPlayer.reset();
            mAudioSrvState = NOT_PLAYING;
        } 
         
Full Snippet Info
8
CodeRank
Related MediaPlayer start Questions & Answers:
Other MediaPlayer start Examples
149:	            }
150:	        }); 
151:			mp.start();
152:		}
153:

Read More

97:						if(mp!=null){
98:							mp.start();
99:							// Changing button image to pause button
100:							btnPlay.setImageResource(R.drawable.btn_pause);
101:						}
-
238:	
239:			/**
240:			 * Button Click event for Play list click event
241:			 * Launches list activity which displays list of songs
242:			 * */

Read More

start Method Overview
Starts or resumes playback.
See Code Examples for other Android MediaPlayer Methods: