iPhone 应用程序中 YouTube 视频完成的通知 [英] Notification of YouTube video completion in iPhone app
问题描述
我按照 YouTube API 博客的方法 #2 毫无困难地嵌入了 YouTube 视频:
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?
推荐答案
恐怕你不走运了.我在大约六个月前搜索过同样的东西,并得出结论,当前的 SDK 是不可能的.我也在堆栈溢出中发布了一个类似的问题.
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
一般来说,如果你需要这种功能,你必须使用MPMoviePlayerCONtroller,不是网络视图.即便如此,我认为此类也不支持 youtube URL.
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.
这篇关于iPhone 应用程序中 YouTube 视频完成的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!