开发者

UIWebView Youtube embed sound plays but no video shows in iOS 3.2 (iPad)

I'm using a UIWebView to display YouTube videos. It works fine on iOS 4+ but doesn't work on the iPad (iOS 3.2). The UIWebView loads as expected and displays the thumbnail of the video. When I tap on the thumbnail I see a gray quicktime icon and can hear sound but no video appears.

This is the code I'm using:

UIWebView* webView = [[UIWebView alloc] initWithFrame: CGRectMake(0,0,320,480)];
NSURL *url = [NSURL URLWithString:@"http://url.to.video/"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];

VideoPlayerController* videoController = [[VideoPlayerController alloc] init];
[[video开发者_运维知识库Controller view] addSubview:webView];
UINavigationController*  theNavController = [[UINavigationController alloc]

initWithRootViewController:videoController];
[self presentModalViewController:theNavController animated:YES];

[videoController release];
[theNavController release];
[webView release];


This is a bug with iOS 3.2 on the iPad. It will (hopefully) be fixed when iOS 4.2 is released in November.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜