按uiwebview时Youtube崩溃

时间:2014-06-05 07:36:15

标签: objective-c ios7 uiwebview youtube crash

uiwebView中的Youtube视频存在问题。当我尝试播放视频时,应用程序崩溃了。但没有错误描述。这只是 iOS 7 中的情况。在iOS 6中,它工作正常。 我使用此代码创建测试应用程序也是如此。但在我的应用程序中没有玩。 哪里可能有错误?有人有想法吗?

这是我的 webView

NSString *embedHtml = [NSString stringWithFormat:@"\
                           <html>\
                           <head>\
                           <style type=\"text/css\">\
                           body {background-color: transparent;}\
                           </style>\
                           </head>\
                           <body style=\"margin:0\">\
                           <iframe src=\"http://www.youtube.com/embed/%@\" width=\"%f\" height=\"%f\"></iframe>\
                           </body>\
                           </html>", @"l3Iwh5hqbyE", self.testView.bounds.size.width-3, self.testView.bounds.size.height];

    [self.testView loadHTMLString:embedHtml baseURL:nil];

0 个答案:

没有答案