Commit 3b85ec45 authored by Carola Nitz's avatar Carola Nitz

VLCPlaybackController: remove state for _playbackFailed

parent 8a138512
Pipeline #224 passed with stage
in 0 seconds
......@@ -48,7 +48,6 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
{
VLCRemoteControlService *_remoteControlService;
BOOL _playerIsSetup;
BOOL _playbackFailed;
BOOL _shouldResumePlaying;
BOOL _sessionWillRestart;
BOOL _shouldResumePlayingAfterInteruption;
......@@ -292,7 +291,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
_playerIsSetup = NO;
[_shuffleStack removeAllObjects];
if (_errorCallback && _playbackFailed && !_sessionWillRestart)
if (_errorCallback && _mediaPlayer.state == VLCMediaPlayerStateError && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_errorCallback];
else if (_successCallback && !_sessionWillRestart)
[[UIApplication sharedApplication] openURL:_successCallback];
......@@ -301,9 +300,7 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
_activeSession = NO;
[_playbackSessionManagementLock unlock];
if (_playbackFailed) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidFail object:self];
} else if (!_sessionWillRestart) {
if (!_sessionWillRestart) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidStop object:self];
} else {
_sessionWillRestart = NO;
......@@ -501,7 +498,9 @@ VLCMediaDelegate, VLCRemoteControlServiceDelegate>
[_mediaPlayer performSelector:@selector(setTextRendererFontForceBold:) withObject:[defaults objectForKey:kVLCSettingSubtitlesBoldFont]];
} else if (currentState == VLCMediaPlayerStateError) {
APLog(@"Playback failed");
_playbackFailed = YES;
dispatch_async(dispatch_get_main_queue(),^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCPlaybackControllerPlaybackDidFail object:self];
});
_sessionWillRestart = NO;
[self stopPlayback];
} else if (currentState == VLCMediaPlayerStateEnded || currentState == VLCMediaPlayerStateStopped) {
......
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