IOS 6 issue with MPMoviePlayerController

Please check the code below:

(void) moviePlayerDidExitFullscreen:(NSNotification*)notification { MPMoviePlayerController *player = [notification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerDidExitFullscreenNotification object:player]; [player setControlStyle:MPMovieControlStyleNone]; if (isPlaying) { [self stopCurrentMoviePlayer]; } } 

The problem is that this works fine in iOS 5 but does not work in iOS 6 iPad3 updates.

The movie player does not close after the video ends, and I need to press the end button each time to close the Movie Player.

Can anyone solve the problem?

+4
source share
1 answer

Clicking on completion will call moviePlayerDidExitFullscreen

But if you allow the end of the movie, moviePlaybackDidFinish is usually called, but with iOS 6 it will not exit full-screen mode. Therefore, the fix is ​​to add player.fullscreen = FALSE; just before the call [player.view removeFromSuperview];

+3
source

Source: https://habr.com/ru/post/1437781/


All Articles