Code example for MediaPlayer

Methods: setOnBufferingUpdateListenersetOnPreparedListener

0
	 
	protected Stream mCurrentStream;
	 
	public MusicManager(ServiceManager manager){
		mSvcMan = manager;
		mPlayer = new MediaPlayer();
		mPlayer.setOnBufferingUpdateListener(this);
		mPlayer.setOnPreparedListener(this);
		mCurrentStream = null;
	} 
	 
	public synchronized void stop(){ 
		if (mCurrentStream != null){
			mPlayer.reset();
			mCurrentStream = null;
		} 
	} 
	 
	public synchronized void play(Stream stream) throws IOException {
		if (mCurrentStream != null){
Contextual code suggestions in your IDE  Get Codota for Java