Commit f8165139 authored by Soomin Lee's avatar Soomin Lee Committed by Carola Nitz

VLCPlaybackController: External: Ignore play in background setting

(closes #269)
parent 6c0198cb
......@@ -453,7 +453,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
manager.presentingViewController = self;
manager.delegate = self;
if (_vpc.renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]) {
if ([_vpc isPlayingOnExternalScreen]) {
[self showOnDisplay:_playingExternalView.displayView];
}
}
......
......@@ -130,6 +130,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)recoverDisplayedMetadata;
- (void)recoverPlaybackState;
- (BOOL)isPlayingOnExternalScreen;
- (void)setNeedsMetadataUpdate;
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
......
......@@ -1237,6 +1237,11 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
_sleepTimer = [NSTimer scheduledTimerWithTimeInterval:timeInterval target:self selector:@selector(stopPlayback) userInfo:nil repeats:NO];
}
- (BOOL)isPlayingOnExternalScreen
{
return (_renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]);
}
#pragma mark - background interaction
- (void)applicationWillResignActive:(NSNotification *)aNotification
......@@ -1244,8 +1249,8 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
#if TARGET_OS_IOS
[self _savePlaybackState];
#endif
if (![[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioInBackgroundKey] boolValue]) {
if (![self isPlayingOnExternalScreen]
&& ![[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinueAudioInBackgroundKey] boolValue]) {
if ([_mediaPlayer isPlaying]) {
[_mediaPlayer pause];
_shouldResumePlaying = YES;
......
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