I am trying to play a YouTube video in UIWebView instead of leaving my application.
Google thinks easy peasy- http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
So, I have a GData structure and headers that work well, and I have no problem doing queries, loading custom video streams, etc.
But what I can not do is upload a specific video. I know the video IDs that I want the channels to be in advance . How to download a specific video?
Then I will follow google instructions:
Grab the video url from the media tag in the API response with the application/x-shockwave-flash type.
and then paste it like this:
// webView is a UIWebView, either initialized programmatically or loaded as part of a xib.
NSString *htmlString = @"<html><head>
<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head>
<body style=\"background:#F00;margin-top:0px;margin-left:0px\">
<div><object width=\"212\" height=\"172\">
<param name=\"movie\" value=\"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"></param>
<param name=\"wmode\" value=\"transparent\"></param>
<embed src=\"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"
type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"212\" height=\"172\"></embed>
</object></div></body></html>";
[webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.your-url.com"]];
Any help would be greatly appreciated!