Ios – Play youtube video in iPhone application

iosiphoneuiwebviewvideoyoutube

I have been trying to figure out how to play a youtube video in an my application without leaving and going to the YouTube App. I have read to embed it into a UIWebView and I tried that but I did not have any success with that at all.

I did something like the following

<html>
<body>
<iframe width="560" height="345" src="http://www.youtube.com/embed/q5WBsBDXqDs?rel=0" frameborder="0" allowfullscreen></iframe>
</body>
</html>

I even tried using the old embed function, but it is not working for me at all. Does anyone have any suggestions? Thanks in advance!

Edit:
I tried it in the the browser and it works just fine, but it does not work in the UIWebView! This is frustrating as to why it does not work.

Best Answer