use the <video> tag On Jan 24, 8:38 am, YoryoBass <[email protected]> wrote: > For sure, this is my source code: > > // Create the video preview frame inside the alertView > UIWebView *videoView; > CGRect videoFrame = CGRectMake(70, 120, 142, 129); > videoView = [[UIWebView alloc] initWithFrame:videoFrame]; > [alertView addSubview:videoView]; > > // Create the html to embed in the alertView > NSString *embedHTML = @"\ > <html><head>\ > <style type=\"text/css\">\ > body {\ > background-color: transparent;\ > color: white;\}\ > > </style>\ > </head><body style=\"margin:0\">\ > <embed id=\"youtubeVideo\" src=\"%@\" type=\"application/x-shockwave- > flash\" \ > width=\"%0.0f\" height=\"%0.0f\"></embed>\ > </body></html>"; > NSString *html = [NSString stringWithFormat:embedHTML, > @"http://www.youtube.com/watch?v=M9wSPssze5g", 142.0, 129.5]; > [videoView loadHTMLString:html baseURL:nil]; > ------------------------------------------ > With the code above, the video plays with no problem, but when I tap > the screen nothing occurs. When the video is finished, it closes and > we retutn to the app. > > But with this one: > > // Create the video preview frame inside the alertView > UIWebView *videoView; > CGRect videoFrame = CGRectMake(70, 120, 142, 129); > videoView = [[UIWebView alloc] initWithFrame:videoFrame]; > [alertView addSubview:videoView]; > > // Create the preview > NSString *videoURLStr = [NSString > stringWithFormat:@"http://www.youtube.com/embed/%@?autoplay=0", > @"M9wSPssze5g"]; > NSURL* videoURL = [NSURL URLWithString:videoURLStr]; > [videoView loadRequest:[NSURLRequest > requestWithURL:videoURL]]; > > I can get the controls to pause the video but when it stops nothing > occurs... > Curious... > > On Jan 24, 5:28 am, Lee Andron <[email protected]> wrote: > > > > > Yoryo, > > > Could you share your code please, or a page for us to check? > > > I managed to perfectly reproduce a YouTube video embedded in a > > > > UIWebView. The video and audio work perfectly, but would need to > > > present the playback controls to get out the video at any time, or to > > > pause. > > > -- > > -Lee Andron > > 617-272-0936http://www.linkedin.com/in/andron
-- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
