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

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

MediaPlayer setLooping examples from Open Source projects
This code example shows how to use the following methods: isLooping, isPlaying, pause, seekTo, setLooping
52:	Boolean playing = ( mp.isLooping() || mp.isPlaying() ); 
-
55:	mp.pause(); 
56:	mp.setLooping(loop); 
57:	mp.seekTo(0); 
58:	mp.start(); 
-
68:	mp.setLooping(loop); 
69:	mp.start(); 
-
98:	mp.setLooping(false); 
99:	mp.seekTo(0); 
100:	mp.start(); 
-
105:	mp.setLooping(true); 
106:	mp.seekTo(0); 
107:	mp.start(); 
-
113:	mp.seekTo(0); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: setLooping
134:	player.setLooping(bLp); 
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: 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: setLooping
193:	mp.setLooping(true); 
Full Snippet Info
7
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, setAudioStreamType, setDataSource, setLooping
72:	if(!player.isPlaying()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAudioStreamType, setDataSource, setLooping, setOnErrorListener
61:	MediaPlayer newPlayer = new MediaPlayer(); 
-
64:	newPlayer.setOnErrorListener(playerErrorListener); 
65:	newPlayer.setDataSource(context, ringtoneUri); 
66:	newPlayer.setLooping(true); 
67:	newPlayer.setAudioStreamType(AudioManager.STREAM_RING); 
Full Snippet Info
8
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: isLooping, prepare, release, setDataSource, setLooping
609:	mp = new MediaPlayer(); 
610:	if (mp.isLooping()) { 
-
614:	mp.setDataSource(filePath); 
615:	mp.prepare(); 
-
617:	mp.setLooping(true); 
618:	if (!mp.isLooping()) { 
-
623:	mp.setLooping(false); 
624:	if (mp.isLooping()) { 
-
633:	mp.release(); 
Full Snippet Info
7
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: 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: isLooping, isPlaying, pause, seekTo, setLooping
52:	Boolean playing = ( mp.isLooping() || mp.isPlaying() ); 
-
55:	mp.pause(); 
56:	mp.setLooping(loop); 
57:	mp.seekTo(0); 
58:	mp.start(); 
-
68:	mp.setLooping(loop); 
69:	mp.start(); 
-
98:	mp.setLooping(false); 
99:	mp.seekTo(0); 
100:	mp.start(); 
-
105:	mp.setLooping(true); 
106:	mp.seekTo(0); 
107:	mp.start(); 
-
113:	mp.seekTo(0); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, reset, setAudioStreamType, setDataSource, setLooping
53:	MediaPlayer mp = new MediaPlayer(); 
-
59:	mp.reset(); 
60:	mp.setAudioStreamType(AudioManager.STREAM_MUSIC); 
61:	mp.setLooping(true); 
62:	mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); 
63:	mp.prepare(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepareAsync, setDataSource, setLooping, setOnPreparedListener
45:	_mp = new MediaPlayer(); 
-
47:	_mp.setDataSource(uri); 
-
51:	_mp.setDataSource(uri); 
52:	_mp.setOnPreparedListener(this); 
53:	_mp.prepareAsync(); 
-
55:	_mp.setLooping(true); 
Full Snippet Info
8
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: 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, 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: setLooping, setOnCompletionListener, setVolume
38:	mp.setLooping(true); 
-
41:	mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
-
61:	mp.setVolume((float)leftVol, (float)rightVol); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, setOnCompletionListener
22:	MediaPlayer mp = new MediaPlayer(); 
-
26:	mp.setDataSource(context, alert); 
27:	mp.setLooping(false); 
28:	mp.setAudioStreamType(AudioManager.STREAM_NOTIFICATION); 
29:	mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
-
36:	mp.prepare(); 
37:	mp.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
47:	mediaPlayer.setDataSource(context, mRingUri); 
-
50:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
51:	mediaPlayer.setLooping(true); 
52:	mediaPlayer.prepare(); 
53:	mediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setLooping, setOnCompletionListener, setVolume
38:	mp.setLooping(true); 
-
41:	mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
-
61:	mp.setVolume((float)leftVol, (float)rightVol); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
196:	mediaPlayer = new MediaPlayer(); 
197:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
-
199:	mediaPlayer.setDataSource(this, uri); 
200:	mediaPlayer.setLooping(false); 
201:	mediaPlayer.prepare(); 
202:	mediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, seekTo, setDataSource, setLooping, setVolume
38:	mBackgroundMediaPlayer.setLooping(true); 
-
42:	mBackgroundMediaPlayer.seekTo(0); 
-
140:	mediaPlayer = new MediaPlayer(); 
141:	mediaPlayer.setDataSource(assetFileDescritor.getFileDescriptor(), 
-
143:	mediaPlayer.prepare(); 
-
145:	mediaPlayer.setVolume(mLeftVolume, mRightVolume); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
47:	mediaPlayer.setDataSource(context, mRingUri); 
-
50:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
51:	mediaPlayer.setLooping(true); 
52:	mediaPlayer.prepare(); 
53:	mediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
39:	mMediaPlayer = new MediaPlayer(); 
40:	mMediaPlayer.setDataSource(context, alert); 
-
43:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
44:	mMediaPlayer.setLooping(false); 
45:	mMediaPlayer.prepare(); 
46:	mMediaPlayer.start(); 
-
48:	mMediaPlayer.stop(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, start
22:	mediaPlayer = new MediaPlayer(); 
-
25:	mediaPlayer.setDataSource(MyApp.getContext(), 
-
41:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); 
42:	mediaPlayer.setLooping(true); 
-
44:	mediaPlayer.prepare(); 
-
52:	mediaPlayer.start(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isLooping, prepare, release, setDataSource, setLooping
609:	mp = new MediaPlayer(); 
610:	if (mp.isLooping()) { 
-
614:	mp.setDataSource(filePath); 
615:	mp.prepare(); 
-
617:	mp.setLooping(true); 
618:	if (!mp.isLooping()) { 
-
623:	mp.setLooping(false); 
624:	if (mp.isLooping()) { 
-
633:	mp.release(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, release, setAudioStreamType, setDataSource, setLooping
32:	alarmPlayer = new MediaPlayer(); 
33:	alarmPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
-
35:	alarmPlayer.setDataSource(context, alarmUri); 
36:	alarmPlayer.setLooping(true); 
37:	alarmPlayer.prepare(); 
-
40:	alarmPlayer.release(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isLooping, isPlaying, pause, seekTo, setLooping
52:	Boolean playing = ( mp.isLooping() || mp.isPlaying() ); 
-
55:	mp.pause(); 
56:	mp.setLooping(loop); 
57:	mp.seekTo(0); 
58:	mp.start(); 
-
68:	mp.setLooping(loop); 
69:	mp.start(); 
-
98:	mp.setLooping(false); 
99:	mp.seekTo(0); 
100:	mp.start(); 
-
105:	mp.setLooping(true); 
106:	mp.seekTo(0); 
107:	mp.start(); 
-
113:	mp.seekTo(0); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying, seekTo, setLooping, setVolume, start
123:	if (!startScreenLoop.isPlaying()) 
-
125:	startScreenLoop.seekTo(0); 
126:	startScreenLoop.setLooping(true); 
-
128:	startScreenLoop.setVolume(volume, volume); 
129:	startScreenLoop.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying, prepare, setLooping, setVolume, start
52:	if (mp.isPlaying()) { 
-
55:	mp.stop(); 
56:	mp.prepare(); 
-
60:	mp.setVolume(volume, volume); 
61:	mp.start(); 
62:	mp.setLooping(loop); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepareAsync, setDataSource, setLooping, setOnPreparedListener
29:	mediaPlayer = new MediaPlayer(); 
30:	mediaPlayer.setDataSource(audioFile); 
31:	mediaPlayer.prepareAsync(); 
32:	mediaPlayer.setOnPreparedListener(this); 
33:	mediaPlayer.setLooping(false); // Set looping 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAudioStreamType, setLooping, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener
20:	mp = new MediaPlayer(); 
21:	mp.setOnErrorListener(this); 
22:	mp.setOnBufferingUpdateListener(this); 
23:	mp.setOnCompletionListener(this); 
24:	mp.setOnPreparedListener(this); 
25:	mp.setAudioStreamType(AudioManager.STREAM_MUSIC); 
26:	mp.setLooping(true); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setLooping, setWakeMode
153:	mediaPlayer = new MediaPlayer(); 
-
159:	mediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK); 
160:	mediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM); 
161:	mediaPlayer.setDataSource(this, uri); 
162:	mediaPlayer.setLooping(true); 
163:	mediaPlayer.prepare(); 
164:	mediaPlayer.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setLooping, setOnInfoListener, setOnSeekCompleteListener
81:	mediaPlayer.setLooping( isLooping ); 
-
100:	mediaPlayer.setOnSeekCompleteListener( this ); 
101:	mediaPlayer.setOnInfoListener( this ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isLooping, prepare, release, setDataSource, setLooping
640:	mp = new MediaPlayer(); 
641:	if (mp.isLooping()) { 
-
645:	mp.setDataSource(filePath); 
646:	mp.prepare(); 
-
648:	mp.setLooping(true); 
649:	if (!mp.isLooping()) { 
-
654:	mp.setLooping(false); 
655:	if (mp.isLooping()) { 
-
664:	mp.release(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isLooping, setLooping
66:	mediaPlayer.setLooping(isLooping()); 
-
86:	return mediaPlayer.isLooping(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: isLooping, setLooping
74:	mediaPlayer.setLooping(isLooping()); 
-
100:	return mediaPlayer.isLooping(); 
Full Snippet Info
4
CodeRank
Related MediaPlayer setLooping Questions & Answers:
setLooping Method Overview
Sets the player to be looping or non-looping.
See Also