Code example for MediaController

Methods: setAnchorView, setEnabled, setMediaPlayer, show

0
 
    // MediaPlayer.OnPreparedListener 
    public void onPrepared(MediaPlayer mp)
    { 
        Log.i(TAG, "CallPlayer onPrepared about to construct MediaController object");
        controller = new MediaController(this, true); // enble fast forward
        //controller = new MyMediaController(this, true); // enble fast forward 
        //controller = new MediaController(getApplicationContext()); // why is useing 'this' different than 'getApplicationContext()' ? 
 
        controller.setMediaPlayer(aplayer);
        controller.setAnchorView(anchor);
        controller.setEnabled(true);
        controller.show(0); //aplayer.getDuration());
         
        // controller disappears after 3 seconds no matter what... set timer to handle re-showing it? 
    } 
 
    public boolean onInfo(MediaPlayer mp, int what, int extra)
    { 
        Log.i(TAG, "CallPlayer onInfo with what " + what + " extra " + extra);
        return false;