开发者

Problem with youtube embed in UIWebView

I inserted a youtube embed code (the iframe code) in a UIWebView on iPhone and since i upgraded to i开发者_运维问答OS 4.3.4 it will not play those videos anymore.

It shows fine in the uiwebview but when tapping the play button it goes blank.

Has anyone had a similar problem?

(I could use the old youtube embed code but it really stirs my display when it is returning)

best regards, broch

Edit (July 30th 2011): It is working again! Really great. Thanks to the guys at YouTube


Check out this link, it looks like its a youtube issue and not us! Engineers are working on it.

http://groups.google.com/group/youtube-api-gdata/browse_thread/thread/394c41dda8b4745a

Greg


I can confirm this issue exists in iOS 4.3.5 as well (tested on an iPhone 4 and iPad 2). We've found that YouTube's embed method no longer works in a UIWebView. The video will usually play but you will only hear the audio.

Falling back to YouTube's old Flash embed code will solve the problem, however it is indeed slower this way. But at least it works.

In the app I'm working on, we retrieve JSON encoded data from a web server. We've simply made it so this data includes the YouTube embed code, which we can change back to the iframe at any time. That way we don't have to keep updating our app every time Apple breaks some functionality, instead we just update our JSON script which only takes a second. Hopefully you can implement some workaround similar to this, or perhaps just go with the old embed code for now until Apple or YouTube addresses the bug.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜