Code example for MediaPlayer.OnCompletionListener

Methods: onCompletion

0
        public void onCompletion(MediaPlayer mp) { 
            if (mMediaController != null) { 
                mMediaController.hide(); 
            } 
            if (mOnCompletionListener != null) { 
                mOnCompletionListener.onCompletion(mMediaPlayer); 
            } 
        } 
    }; 
 
    private MediaPlayer.OnErrorListener mErrorListener =
        new MediaPlayer.OnErrorListener() { 
        public boolean onError(MediaPlayer mp, int a, int b) { 
            Log.d("VideoView", "Error: " + a + "," + b); 
            if (mMediaController != null) { 
                mMediaController.hide(); 
            } 
 
            /* If an error handler has been supplied, use it and finish. */ 
            if (mOnErrorListener != null) { 
                if (mOnErrorListener.onError(mMediaPlayer, a, b)) {