Commit 6c464d56 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

fix potential exceptions when handling media content which is not part of the media library

parent 80b3bfdb
......@@ -178,7 +178,8 @@
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
[_mediaPlayer pause];
[super viewWillDisappear:animated];
self.mediaItem.lastPosition = @([_mediaPlayer position]);
if (self.mediaItem)
self.mediaItem.lastPosition = @([_mediaPlayer position]);
[_mediaPlayer stop];
}
......@@ -549,15 +550,13 @@
- (void)applicationWillResignActive:(NSNotification *)aNotification
{
NSLog(@"applicationWillResignActive");
self.mediaItem.lastPosition = @([_mediaPlayer position]);
if (self.mediaItem)
self.mediaItem.lastPosition = @([_mediaPlayer position]);
if (![[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioInBackgroundKey] intValue]) {
NSLog(@"pausing playback");
[_mediaPlayer pause];
_shouldResumePlaying = YES;
} else
NSLog(@"continuing playback");
}
}
- (void)applicationDidEnterBackground:(NSNotification *)notification
......
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