首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS应用- youtube视频iOS7

iOS应用- youtube视频iOS7
EN

Stack Overflow用户
提问于 2014-01-17 06:54:12
回答 1查看 361关注 0票数 0

在全屏模式下播放youtube视频时,应用程序会崩溃。它嵌入在UIWebView中,嵌入到viewController中,并在rootViewController of window上进行了建模。

如何解决这个问题?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2014-01-17 07:09:03

由于声誉不足,我不能发表评论。你能给我们看看你是怎么做到的吗?我就是这样做的,MoviePlayer对我来说很好:

代码语言:javascript
复制
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];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21179664

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档