Skip to content

Commit 4a26088

Browse files
committed
Fixed issue with movie player notification handling
1 parent 3eb597f commit 4a26088

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Pod/Classes/MWPhotoBrowser.m

+5-3
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ - (void)_playVideo:(NSURL *)videoURL atPhotoIndex:(NSUInteger)index {
12261226

12271227
- (void)videoFinishedCallback:(NSNotification*)aNotification {
12281228

1229+
// Remove observer
1230+
[[NSNotificationCenter defaultCenter] removeObserver:self
1231+
name:MPMoviePlayerPlaybackDidFinishNotification
1232+
object:_currentVideoPlayerViewController.moviePlayer];
1233+
12291234
// Dismiss with our modal transition
12301235
[self dismissViewControllerAnimated:YES completion:nil];
12311236

@@ -1236,9 +1241,6 @@ - (void)videoFinishedCallback:(NSNotification*)aNotification {
12361241

12371242
- (void)clearCurrentVideo {
12381243
if (!_currentVideoPlayerViewController) return;
1239-
[[NSNotificationCenter defaultCenter] removeObserver:self
1240-
name:MPMoviePlayerPlaybackDidFinishNotification
1241-
object:_currentVideoPlayerViewController.moviePlayer];
12421244
[_currentVideoLoadingIndicator removeFromSuperview];
12431245
_currentVideoPlayerViewController = nil;
12441246
_currentVideoLoadingIndicator = nil;

0 commit comments

Comments
 (0)