Commit 9acd094f authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

playback: improve pausing when headphones are unplugged

(cherry picked from commit 131898e3)
parent 713ee565
......@@ -727,10 +727,13 @@ NSString *const VLCPlaybackControllerPlaybackDidFail = @"VLCPlaybackControllerPl
- (void)audioSessionRouteChange:(NSNotification *)notification
NSArray *outputs = [[AVAudioSession sharedInstance] currentRoute].outputs;
NSString *portName = [[outputs objectAtIndex:0] portName];
NSString *portName = [[outputs firstObject] portName];
if (![portName isEqualToString:@"Headphones"] && [_mediaPlayer isPlaying])
[_listPlayer pause];
if (![portName isEqualToString:@"Headphones"] && [_mediaPlayer isPlaying]) {
[_mediaPlayer pause];
[self _savePlaybackState];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidPause object:self];
#pragma mark - Managing the media item
Supports Markdown
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