Auto-Playing a YouTube Video From Inside a UIWebView

Well I have been searching for an answer to this all day and finally someone has the goods! Basically I wanted to auto play a Youtube video that has been embedded in a WebUIView on the iPhone/iPod touch. Javascript or embed object attributes such as autostart and autoplay=1 didn’t work and reading the post below you’ll see why.

http://silentmac.com/?p=453

Here’s the main code snipped you’ll need anyway. Put this in your “.m” file that contains your WebUIView.



Write a comment

  • Required fields are marked with *.


If you have trouble reading the code, click on the code itself to generate a new random code.
 

Hiep
Posts: 1
Comment
No auto play at all
Reply #1 on : Fri November 11, 2011, 09:33:48
This solution is also mentioned in this article http://sarojsblog.blogspot.com/2011/03/autoplay-youtube-video-in-iphone-ipad.html

I tried this many ways but it did not work! It seems the function findButtoninView is not working correctly.

Have you got the whole source code of the example?