I am using this code to play YouTube videos on iOS
- (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame
{
NSString *htmlString = [NSString stringWithFormat:@"<html><head><meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = yes, width = 320\"/></head><body style=\"background:#00;margin-top:0px;margin-left:0px\"><div><object width=\"320\" height=\"180\"><param name=\"movie\" value=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"180\"></embed></object></div></body></html>", urlString, urlString];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:htmlString baseURL:nil];
[self.view addSubview:videoView];
[videoView release];
}
It works like charm but I want a different behaviour. Now a thumbnail of the video appears on the webview (nice!) but when I tap the play icon it opens in full screen. I need that playback is done in the same window since I need to show more stuff.
Any clue of how making that? Thansk in advance