开发者

YouTube javascript API accessible via UIWebView on iPad?

I can't seem to get this working using stringByEvaluatingJavascriptFromString. Apparently the webview does something peculiar to youtube videos (due to the YouTubePlugIn.webplugin perhaps?) and the javascript API is unusable.

The problem I'm having: How do I pause\stop a video when the user navigates away from a UIWebView with an embedded YouTube video?

Right now the only t开发者_运维百科hing I can think off is reloading the view from a string before navigating away... but that seems heavy and hackish.

Has anyone had any luck with this?


Loading an empty string is the only thing I have found that works right now.

I am trying to play the video in a popover, and clicking off the popover (closing it), causes the sound to still play in the background until a new video is selected. The solution to this is to load an empty string. Unfortunately, if they fullscreen, clicking off the popover to close it (because it sits on top of the fullscreen video) loads the empty string, and then the entire application crashes. :(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜