在全屏模式下播放youtube视频时,应用程序会崩溃。它嵌入在UIWebView中,嵌入到viewController中,并在rootViewController of window上进行了建模。
如何解决这个问题?
谢谢。
发布于 2014-01-17 07:09:03
由于声誉不足,我不能发表评论。你能给我们看看你是怎么做到的吗?我就是这样做的,MoviePlayer对我来说很好:
NSString *youTubeURL = @"https://www.youtube.com/v/VCTen3-B8GU";
NSMutableString *html = [[NSMutableString alloc] initWithCapacity:1];
[html appendString:@"<html><head>"];
[html appendString:@"<style type=\"text/css\">"];
[html appendString:@"body {"];
[html appendString:@"background-color: transparent;"];
[html appendString:@"color: white;"];
[html appendString:@"}"];
[html appendString:@"</style>"];
[html appendString:@"</head><body style=\"margin:0\">"];
[html appendFormat:@"<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\"", youTubeURL];
[html appendFormat:@"width=\"%0.0d\" height=\"%0.0d\"></embed>", 320, 200];
[html appendString:@"</body></html>"];
[self.view loadHTMLString:html baseURL:nil];https://stackoverflow.com/questions/21179664
复制相似问题