在移动浏览器中播放视频后通知 [英] Notification after Video playback in mobile safari
问题描述
我正在尝试在 UIWebView
中播放一些视频,并且要求在视频播放完成时获得一些反馈,而无需任何用户交互.我正在寻找与 MPMoviePlayerPlaybackDidFinishNotification
类似的东西,但在 UIWebView
中.欣赏是否有人可以共享工作.
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.
推荐答案
我不能担保所有视频类型,但是当我在 UIWebView
中播放YouTube视频时,当用户通过订阅私人通知类型来按完成":
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:自我选择器:@selector(moviePlayerDidExitFullscreen :)名称:@"UIMoviePlayerControllerDidExitFullscreenNotification"对象:无];
这适用于iOS 4.3和5.0.
This works in iOS 4.3 and 5.0.
这篇关于在移动浏览器中播放视频后通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!