Skip to content

Instantly share code, notes, and snippets.

@isaidamier
Last active September 8, 2017 23:04
Show Gist options
  • Save isaidamier/48d605a18dfeb2610be47307cd261a62 to your computer and use it in GitHub Desktop.
Save isaidamier/48d605a18dfeb2610be47307cd261a62 to your computer and use it in GitHub Desktop.
@Override
public void onPause() {
super.onPause();
if (Util.SDK_INT <= 23) {
releasePlayer();
}
}
@Override
public void onStop() {
super.onStop();
releasePlayer();
}
private void releasePlayer() {
if (null != player) {
player.release();
player = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment