Created
April 12, 2013 22:10
-
-
Save billy-bacon/5375565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public MediaController getMediaController(Context context) { | |
MediaController mediaController = new MediaController(context) { | |
@Override | |
public void setMediaPlayer(MediaPlayerControl player) { | |
super.setMediaPlayer(player); | |
//todo: this causes things to blow up since the Activity is not initialized yet when this is called? | |
//show(0); | |
} | |
@Override | |
public void show(int timeout) { | |
super.show(timeout); | |
} | |
@Override | |
public void hide() { | |
this.show(); // this will force the media controller ot ALWAYS show and never hide | |
} | |
@Override | |
public boolean dispatchKeyEvent(KeyEvent event) { | |
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { | |
Log.d(TAG, "Calling Activity.finish() since back button was clicked..."); | |
//todo: Need to release/stop the player and kill the session here. presenter.release() blows sky-fucking-high | |
// presenter.release(); | |
} | |
return true; | |
} | |
}; | |
return mediaController; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment