Code example for MediaPlayer: Playing audio and video

Methods: getCurrentPositiongetDurationsetOnSeekCompleteListenerstart

0
            public void onSeekComplete(MediaPlayer mediaPlayer) {
              if (D)
                Log.d(
                    TAG,
                    "current audio position... " 
                        + mMediaPlayer.getCurrentPosition());
              mMediaPlayer.start();
              mMediaPlayer.setOnSeekCompleteListener(null);
 
              // If the endtime is valid, start an async task to loop until the 
              // audio gets to the endtime 
              if (endTimeMS < mMediaPlayer.getDuration()) {
                mListenForEndAudioInterval = new ListenForEndAudioInterval();
                mListenForEndAudioInterval.setEndAudioInterval(endTimeMS);
                mListenForEndAudioInterval.execute();
              } 
            } 
          }); 
    } else { 
      if (mRequestedMediaPlayer < 2) {
Contextual code suggestions in your IDE  Get Codota for Java