Can a UIWebView raise an event triggered by a MediaPlayer done button

I want to use UIWebView to load url and play vedios. When I click a button in a MediaPlayer control on a UIWebView , I want to do something.
My question is: in this case, it may be OK, or does UIWwebView have a delegate method after clicking Finish?

+4
source share
1 answer

The Finish button is only displayed in full screen mode. You can detect the end of full-screen mode by observing the @"UIMoviePlayerControllerDidExitFullscreenNotification" mode:

 - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerDidExitFullscreen:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil]; } - (void)viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)moviePlayerDidExitFullScreen:(NSNotification *)notification { // This is where you do whatever you want because the user pressed "Done". } 

UIMoviePlayerControllerDidExitFullscreenNotification not documented, so I don’t know if it will go through the App Store. If you do not plan to distribute through the App Store, it does not matter.

+3
source

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


All Articles