From 3bdb2ae61893c16863e933e01813187fda56f84a Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 30 Nov 2016 19:38:02 +0800 Subject: [PATCH] remove the duplicate performance of -dlc_videoWillStop --- DLCMobilePlayer/Classes/DLCBaseVideoView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DLCMobilePlayer/Classes/DLCBaseVideoView.m b/DLCMobilePlayer/Classes/DLCBaseVideoView.m index 3f35267..9b32e7c 100644 --- a/DLCMobilePlayer/Classes/DLCBaseVideoView.m +++ b/DLCMobilePlayer/Classes/DLCBaseVideoView.m @@ -421,8 +421,8 @@ - (void)pause { - (void)stop { self.playing = NO; dispatch_barrier_async(self.playerControlQueue, ^{ - [self.mediaPlayer stop]; self.videoPlayed = NO; + [self.mediaPlayer stop]; }); } @@ -647,7 +647,7 @@ - (void)mediaPlayerStateChanged:(NSNotification *)aNotification { case VLCMediaPlayerStateError: case VLCMediaPlayerStateStopped: case VLCMediaPlayerStateEnded: - if ([self.videoActionDelegate respondsToSelector:@selector(dlc_videoWillStop)]) { + if ([self.videoActionDelegate respondsToSelector:@selector(dlc_videoWillStop)] && self.isVideoPlayed) { [self.videoActionDelegate dlc_videoWillStop]; } case VLCMediaPlayerStatePaused: