- // ViewController.m
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- CGRect frame = CGRectMake(20, 20, 280, 280);
- [self embedYouTube:link andFrame:frame andView:self.view];
- }
- //Método para colocar um video do youtube em um UIWebView
- {
- <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>";
- UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame];
- [videoView loadHTMLString:html baseURL:nil];
- [view addSubview:videoView];
- [videoView release];
- }
Donwload: VideoYoutube.zip