iPhone 应用程序中 YouTube 视频完成的通知
我已经按照 YouTube API 博客的方法 #2 毫无困难地嵌入了 YouTube 视频:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
有什么方法可以知道视频何时播放播放完毕(或者当用户按下影片控制器上的“完成”按钮时)?
例如,假设您想要播放播放列表中的每个视频,而不需要用户与应用程序交互。有什么时间开始下一个视频的钩子吗?
I've embedded the YouTube video with no difficulties following method #2 of the YouTube API Blog:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
Is there any way to know when the video has finished playing (or when the user presses the Done button on the movie controller)?
For instance, say you wanted to play each video in a playlist without requiring the user to interact with the app. Is there any hook for when to start the next video?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
恐怕你运气不好。我大约六个月前搜索过同样的事情,并得出结论:当前的 SDK 不可能实现这一点。我也在堆栈溢出中发布了类似的问题。
https://stackoverflow.com/questions/4011796/notification-after-video- playback-in-mobile-safari
一般来说,如果你需要这种功能,你必须使用 MPMoviePlayerCOntroller,不是 Web 视图。即使如此,我也不认为此类支持 YouTube URL。
I am afraid you are out of luck. I have searched for the same thing around six months before and came to the conclusion that it is not possible with the current SDK. I have posted a similar question in stack overflow too.
https://stackoverflow.com/questions/4011796/notification-after-video-playback-in-mobile-safari
In general, if you need this kind of functionality, you have to use MPMoviePlayerCOntroller, not a web view.Even then, I don't think youtube URLs are supported by this class.
根据 smoothlandon 的帖子,这是我用来确定 YouTube/Safari 窗口是否仍然处于活动状态的方法。我的应用程序非常简单,它只有主窗口和加载的 YouTube/Safari 视图。
视图加载:
Going by smoothlandon's post, this is what I implemented to determine if the YouTube/Safari window is still active. My App is really simple and it only has the main window, and a YouTube/Safari view that loads.
viewDidLoad: