Notification after Video playback in mobile safari

北战南征 提交于 2019-12-13 04:34:14

问题


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.



来源:https://stackoverflow.com/questions/4011796/notification-after-video-playback-in-mobile-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!