Code example for MediaPlayer

Methods: isPlaying

0
      updatePlayPauseButton(); 
    } 
 
    public boolean isPlaying() { 
        if (mMediaPlayer != null) {
            return mMediaPlayer.isPlaying();
        } else { 
            return false; 
        } 
    } 
 
    public void updatePlayPauseButton() { 
        mPlayPauseButton.setImageResource(isPlaying() ? mPauseImageResource : mPlayImageResource);
    } 
 
    public void attachAuxEffect(int effectId) {
        mEffectId = effectId;
        if (mMediaPlayer != null) {
            Log.d(TAG,"attach effect: "+effectId);
            mMediaPlayer.attachAuxEffect(effectId);
        }