Man, I'm always impressed at how responsive this forum is.
Anyway, here is the embed code that I found on the web and tweaked:
- (void)embedYouTube {
NSString* embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
CGRect frame;
frame.size.width=100; frame.size.height=80;
frame.origin.x=10; frame.origin.y=10;
NSString *url=@"http://www.youtube.com/watch?v=g8thp78oXsg";
NSString* html = [NSString stringWithFormat:embedHTML,url, 100, 80];
UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
[videoView loadHTMLString:html baseURL:[NSURL URLWithString:nil]];
[self.view addSubview:videoView];
[videoView release];
NSLog(@" in embed %@",html);
}
I put the sample URL in, uhh, 'url' above to show which URL I'm using (whew, lots of urls).