The problem with embedding youtube in a UIWebView

I pasted the youtube embed code (iframe code) into the UIWebView on the iPhone, and since I upgraded to iOS 4.3.4, it will no longer play these videos.

This is clearly visible in uiwebview, but when you click on the play button, it becomes empty.

Has anyone had a similar problem?

(I could use the old youtube embed code, but it really changes my display when it returns)

Regards Broch

Edit (July 30, 2011): it works again! Really cool. Thanks guys on YouTube

+4
source share
2 answers

Check out this link, it seems like a problem with youtube, not us! Engineers are working on it.

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

Greg

+2
source

I can confirm that this problem exists in iOS 4.3.5 (tested on iPhone 4 and iPad 2). We found that the YouTube embed method no longer works in UIWebView. Usually the video plays, but you only hear the sound.

Returning to the old version of Flash built into YouTube will solve this problem, however it is really slower. But at least it works.

In the application I'm working on, we get JSON-encoded data from a web server. We just made this data include the embed code for YouTube, which we can change in the iframe at any time. Thus, we do not need to constantly update our application every time Apple breaks some functions, instead we just update our JSON script, which takes only a second. Hopefully you can implement some workaround like this, or maybe just go with the old embed code until Apple or YouTube get the error.

+2
source

All Articles