Code example for MediaPlayer: Playing audio and video

Methods: seekTostart

0
		} else if (loop >= 0) {
			this.loopsLeft = loop;
			mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
				@Override public void onCompletion(MediaPlayer mp) {
					if (--mmp.loopsLeft > 0) {
						mp.seekTo(0);
						mp.start();
					} else { 
						mmp.setComplete();
					} 
				} 
			}); 
		} 
	} 
 
	public ManagedMediaPlayer setMediaPlayer(MediaPlayer mp) {
		this.mp = mp;
		return this;
	} 
 
	public void setVolume(float leftVol, float rightVol) {