Code example for MediaController

Methods: setAnchorView, setEnabled, setMediaPlayer

0
        } 
    } 
	 
    private void attachMediaController() { 
        if (mMediaPlayer != null && mMediaController != null) {
            mMediaController.setMediaPlayer(this);
            View anchorView = this.getParent() instanceof View ?
                    (View)this.getParent() : this;
            mMediaController.setAnchorView(anchorView);
            mMediaController.setEnabled(mIsPrepared);
        } 
    } 
	 
	MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() {
        public void onPrepared(MediaPlayer mp) { 
            // briefly show the mediacontroller 
            mIsPrepared = true; 
            if (mOnPreparedListener != null) { 
                mOnPreparedListener.onPrepared(mMediaPlayer); 
            } 
            if (mMediaController != null) {