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
1 changed files with 14 additions and 3 deletions

View File

@ -39,13 +39,24 @@ public class VideoplayerActivity extends MediaplayerActivity implements
@Override
protected void 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
&& PlaybackService.isPlayingVideo()) {
playbackService.stop();
}
if (videoControlsToggler != null) {
videoControlsToggler.cancel(true);
}
}
@Override