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

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

MediaPlayer seekTo examples from Open Source projects
This code example shows how to use the following methods: seekTo
156:	if(stream && player!=null) player.seekTo(ms); // 0 = start, 1 = end; 
Full Snippet Info
9
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
9
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, seekTo, stop
103:	if(mPlayer.isPlaying()) 
-
105:	mPlayer.stop(); 
-
108:	mPlayer.prepare(); 
109:	mPlayer.seekTo(0); 
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: seekTo
95:	player.seekTo(0); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isPlaying, pause, seekTo
100:	if (androidpad!=null) androidpad.seekTo(0); 
-
192:	if (androidpad!=null && androidpad.isPlaying()) { 
193:	androidpad.pause(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: seekTo
107:	this.mMediaPlayer.seekTo(pMilliseconds); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getCurrentPosition, getDuration, isPlaying, pause, seekTo
280:	int skipOffset = 10000 + mediaPlayer.getCurrentPosition(); 
281:	int duration = mediaPlayer.getDuration(); 
-
288:	mediaPlayer.seekTo(skipOffset); 
-
294:	int skipOffset = mediaPlayer.getCurrentPosition() - 10000; 
-
301:	mediaPlayer.seekTo(skipOffset); 
-
306:	if (mediaPlayer.isPlaying()) { 
307:	mediaPlayer.pause(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: seekTo
26:	mediaPlayer.seekTo((int) pos); 
Full Snippet Info
6
CodeRank
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, 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: seekTo
27:	mediaPlayer.seekTo(pos); 
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: 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: seekTo
105:	player.seekTo((int)(microseconds / 1000)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCurrentPosition, getDuration, prepare, release, seekTo
467:	MediaPlayer mp = new MediaPlayer(); 
-
469:	mp.setDataSource(filePath); 
470:	mp.prepare(); 
471:	duration = mp.getDuration(); 
472:	mp.seekTo(duration - 10000); 
473:	mp.start(); 
474:	currentPosition=mp.getCurrentPosition(); 
475:	mp.stop(); 
476:	mp.release(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isPlaying, seekTo, start
20:	if (this.player.isPlaying()) { 
21:	this.player.seekTo(0); 
-
23:	this.player.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: isLooping, isPlaying, pause, release, seekTo
75:	if ( mp.isLooping() || mp.isPlaying() ) 
-
78:	mp.pause(); 
79:	mp.seekTo(0); 
-
91:	mp.release(); 
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: release, seekTo, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener
426:	mMediaPlayer.stop(); 
427:	mMediaPlayer.seekTo(0); 
-
503:	mMediaPlayer.release(); 
-
505:	mMediaPlayer.setOnBufferingUpdateListener(null); 
506:	mMediaPlayer.setOnCompletionListener(null); 
507:	mMediaPlayer.setOnErrorListener(null); 
508:	mMediaPlayer.setOnInfoListener(null); 
509:	mMediaPlayer.setOnPreparedListener(null); 
510:	mMediaPlayer.setOnSeekCompleteListener(null); 
Full Snippet Info
4
CodeRank
Related MediaPlayer seekTo Questions & Answers:
Other MediaPlayer seekTo Examples
119:						// forward song
120:						mp.seekTo(currentPosition + seekForwardTime);
121:					}else{
122:						// forward to end position
123:						mp.seekTo(mp.getDuration());
-
122:						// forward to end position
123:						mp.seekTo(mp.getDuration());
124:					}
125:				}
126:			});
-
318:				   // Displaying Total Duration time
319:				   songTotalDurationLabel.setText(""+utils.milliSecondsToTimer(totalDuration));
320:				   // Displaying time completed playing
321:				   songCurrentDurationLabel.setText(""+utils.milliSecondsToTimer(currentDuration));
322:

Read More

seekTo Method Overview
Seeks to specified time position.
See Also