I am trying to play some videos in a UIWebView
and required to get some feedback when the video playback is finished, without any user interaction. I am looking for something similar to MPMoviePlayerPlaybackDidFinishNotification
, but in UIWebView
. Appreciate if anyone can share a work around.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I can't vouch for all video types but when I play a YouTube video in a UIWebView
I can capture the event when the user presses 'Done' by subscribing to a private notification type:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerDidExitFullscreen:) name:@"UIMoviePlayerControllerDidExitFullscreenNotification" object:nil];
This works in iOS 4.3 and 5.0.