Bugfix: Videoplayer crashed when screen was turned off
This commit is contained in:
parent
add5ce69d3
commit
0e7b1a9f39
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue