Bugfix: Videoplayer crashed when screen was turned off

This commit is contained in:
daniel oeh 2012-08-05 15:43:03 +02:00
parent add5ce69d3
commit 0e7b1a9f39

View File

@ -39,13 +39,24 @@ public class VideoplayerActivity extends MediaplayerActivity implements
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
if (videoControlsToggler != null) {
videoControlsToggler.cancel(true);
}
if (PlaybackService.isRunning && playbackService != null
&& PlaybackService.isPlayingVideo()) {
playbackService.pause(true);
}
}
@Override
protected void onStop() {
super.onStop();
if (PlaybackService.isRunning && playbackService != null if (PlaybackService.isRunning && playbackService != null
&& PlaybackService.isPlayingVideo()) { && PlaybackService.isPlayingVideo()) {
playbackService.stop(); playbackService.stop();
} }
if (videoControlsToggler != null) {
videoControlsToggler.cancel(true);
}
} }
@Override @Override