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
This code example shows how to use the following methods: start
This code example shows how to use the following methods: start
This code example shows how to use the following methods: seekTo, setLooping, start
105:	mp.setLooping(true); 
106:	mp.seekTo(0); 
107:	mp.start(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: prepare, seekTo, start, stop
135:	mBackgroundMediaPlayer.stop(); 
-
138:	mBackgroundMediaPlayer.prepare(); 
139:	mBackgroundMediaPlayer.seekTo(0); 
140:	mBackgroundMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isPlaying, prepare, setAudioStreamType, setDataSource, start
151:	return player != null && player.isPlaying(); 
-
184:	player.setDataSource(s); 
185:	player.setAudioStreamType(AudioManager.STREAM_MUSIC); 
186:	player.prepare(); 
-
191:	player.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLooping, start
72:	_mediaPlayer.start(); 
-
82:	_mediaPlayer.setLooping(true); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
38:	mMediaPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setOnBufferingUpdateListener, setOnCompletionListener, start
155:	mPlayer.setOnCompletionListener(this); 
156:	mPlayer.setOnBufferingUpdateListener(new OnBufferingUpdateListener() 
-
164:	mPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepare, seekTo, setLooping, start, stop
93:	mBackgroundMediaPlayer.stop(); 
-
95:	mBackgroundMediaPlayer.setLooping(isLoop); 
-
98:	mBackgroundMediaPlayer.prepare(); 
99:	mBackgroundMediaPlayer.seekTo(0); 
100:	mBackgroundMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLooping, start
142:	mediaPlayer.setLooping(loopEnabled); 
143:	mediaPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: start
66:	mediaPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setLooping, start
27:	mediaPlayer.setLooping(true); 
28:	mediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isPlaying, prepare, reset, setDataSource, start
24:	if (!mediaPlayer.isPlaying() && currentTrack != null) { 
-
27:	mediaPlayer.reset(); 
28:	mediaPlayer.setDataSource(currentTrack); 
29:	mediaPlayer.prepare(); 
-
32:	mediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, start
62:	MediaPlayer mediaPlayer = new MediaPlayer(); 
-
65:	mediaPlayer.setDataSource(file); 
66:	mediaPlayer.prepare(); 
67:	mediaPlayer.start(); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setOnCompletionListener, start
57:	MediaPlayer mediaPlayer = new MediaPlayer(); 
-
59:	mediaPlayer.setDataSource(context, 
-
70:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION); 
-
72:	mediaPlayer.prepare(); 
-
78:	mediaPlayer.start(); 
79:	mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
100:	mPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
-
103:	mPlayer.setDataSource(this, url); 
104:	mPlayer.prepare(); 
105:	mPlayer.setLooping(true); 
106:	mPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: start
219:	mediaPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setVolume, start
52:	player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
-
58:	player.setDataSource(file.getFileDescriptor(), file.getStartOffset(), file.getLength()); 
-
60:	player.setVolume(0.2f, 0.2f); 
61:	player.prepare(); 
62:	player.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepare, release, setDataSource, start, stop
51:	MediaPlayer mp = new MediaPlayer(); 
52:	mp.setDataSource(filePath); 
53:	mp.prepare(); 
54:	mp.start(); 
55:	Thread.sleep(200000); 
56:	mp.stop(); 
57:	mp.release(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: isPlaying, setLooping, setVolume, start
44:	mp.setLooping(false); 
-
52:	if (!mp.isPlaying()) { 
-
55:	mp.setVolume(pct, pct); 
56:	mp.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying, prepare, reset, setDataSource, start
70:	if (mPlayer.isPlaying()) 
71:	mPlayer.stop(); 
72:	mPlayer.reset(); 
-
77:	mPlayer.setDataSource(mFile); 
78:	mPlayer.prepare(); 
79:	mPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnErrorListener, start
214:	mPlayer = new MediaPlayer(); 
-
216:	mPlayer.setDataSource(mSampleFile.getAbsolutePath()); 
217:	mPlayer.setOnCompletionListener(this); 
218:	mPlayer.setOnErrorListener(this); 
219:	mPlayer.prepare(); 
220:	mPlayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: start
This code example shows how to use the following methods: seekTo, start
44:	mp.seekTo(0); 
45:	mp.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, reset, setDataSource, start, stop
38:	player.stop(); 
-
40:	player.reset(); 
-
42:	player.setDataSource(mp3); 
43:	player.prepare(); 
-
45:	player.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, reset, setDataSource, start
20:	player.reset(); 
-
25:	player.setDataSource(intent.getStringExtra("url")); 
-
42:	player.prepare(); 
-
51:	player.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, seekTo, start, stop
107:	mBackgroundMediaPlayer.stop(); 
-
110:	mBackgroundMediaPlayer.prepare(); 
111:	mBackgroundMediaPlayer.seekTo(0); 
112:	mBackgroundMediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnBufferingUpdateListener, setOnCompletionListener, start
155:	mPlayer.setOnCompletionListener(this); 
156:	mPlayer.setOnBufferingUpdateListener(new OnBufferingUpdateListener() 
-
164:	mPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, prepare, reset, seekTo, setDataSource
54:	int pos = mp.getCurrentPosition(); 
55:	mp.reset(); 
-
57:	mp.setDataSource(ctx, video); 
58:	mp.prepare(); 
59:	mp.start(); 
-
69:	mp.seekTo(pos); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLooping, setVolume, start
221:	mMediaPlayer.setVolume((float)inVolLeft,(float)inVolRight); 
-
223:	mMediaPlayer.setLooping(true); 
-
227:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDuration, prepare, release, setDataSource, start
573:	MediaPlayer mp = new MediaPlayer(); 
574:	mp.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(), afd.getLength()); 
575:	mp.prepare(); 
576:	mp.start(); 
577:	duration = mp.getDuration(); 
578:	Thread.sleep(5000); 
579:	mp.release(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepare, release, setDataSource, start, stop
51:	MediaPlayer mp = new MediaPlayer(); 
52:	mp.setDataSource(filePath); 
53:	mp.prepare(); 
54:	mp.start(); 
55:	Thread.sleep(200000); 
56:	mp.stop(); 
57:	mp.release(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: prepare, reset, setDataSource, start
51:	mMediaPlayer.reset(); 
-
55:	mMediaPlayer.setDataSource(path); 
56:	mMediaPlayer.prepare(); 
-
62:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
36:	mediaplayer.start(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: isLooping, isPlaying, prepare, reset, setDataSource
87:	if (mp.isPlaying() || mp.isLooping()) { 
88:	mp.stop(); 
-
90:	mp.reset(); 
-
92:	mp.setDataSource(fis.getFD()); 
93:	mp.prepare(); 
94:	mp.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setLooping, setVolume, start
93:	mPlayer.setLooping(boLoop); 
94:	mPlayer.setVolume(streamVolume, streamVolume); 
95:	mPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, reset, setDataSource, setLooping, setVolume
49:	mp.reset(); 
50:	mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength()); 
51:	mp.prepare(); 
52:	mp.setVolume(0.5f, 0.5f); 
53:	mp.setLooping(repeat); 
54:	mp.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: seekTo, setLooping, start
105:	mp.setLooping(true); 
106:	mp.seekTo(0); 
107:	mp.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setDisplay, start
70:	mMediaPlayer = new MediaPlayer(); 
71:	mMediaPlayer.setDataSource(videoPath); 
72:	mMediaPlayer.setDisplay(holder); 
73:	mMediaPlayer.prepare(); 
74:	mMediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, start
45:	mMediaPlayer.setDataSource(videoPath); 
46:	mMediaPlayer.prepare(); 
-
54:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
55:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
This code example shows how to use the following methods: start
217:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
74:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
157:	mMediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: start
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 Also