Commit 33fd465e authored by Felix Paul Kühne's avatar Felix Paul Kühne

Movie View: be nice with the user's battery and stop video decoding when app...

Movie View: be nice with the user's battery and stop video decoding when app is in background (close #8678)
parent 59d2b84c
......@@ -373,11 +373,10 @@
- (IBAction)playPause
{
if ([_mediaPlayer isPlaying]) {
if ([_mediaPlayer isPlaying])
[_mediaPlayer pause];
} else {
else
[_mediaPlayer play];
}
}
- (IBAction)forward:(id)sender
......@@ -543,7 +542,8 @@
if (![[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioInBackgroundKey] intValue]) {
[_mediaPlayer pause];
_shouldResumePlaying = YES;
}
} else
_mediaPlayer.currentVideoTrackIndex = 0;
}
- (void)applicationDidEnterBackground:(NSNotification *)notification
......@@ -553,11 +553,11 @@
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
NSLog(@"applicationDidBecomeActive");
if (_shouldResumePlaying) {
_shouldResumePlaying = NO;
[_mediaPlayer play];
}
} else
_mediaPlayer.currentVideoTrackIndex = 1;
}
#pragma mark - autorotation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment