【问题标题】:iOS APP - youtube video iOS7iOS APP - youtube 视频 iOS7
【发布时间】:2014-01-17 06:54:12
【问题描述】:

在全屏模式下播放 youtube 视频时应用程序崩溃。 它在UIWebView 中嵌入在viewController 中,以模态方式呈现在windowrootViewController 上。

如何解决这个问题?

谢谢。

【问题讨论】:

标签: ios objective-c youtube


【解决方案1】:

由于缺乏声誉,我无法发表评论。您能否向我们展示一些代码,您是如何做到这一点的。 我正在这样做,它对我来说与 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];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-19
    • 2014-06-15
    • 1970-01-01
    • 2011-07-09
    • 2011-11-21
    • 2016-11-15
    • 2014-11-10
    相关资源
    最近更新 更多