Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
9acd094f
Commit
9acd094f
authored
Jun 10, 2015
by
Felix Paul Kühne
Browse files
playback: improve pausing when headphones are unplugged
(cherry picked from commit
131898e3
)
parent
713ee565
Changes
1
Hide whitespace changes
Inline
Side-by-side
Sources/VLCPlaybackController.m
View file @
9acd094f
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment