iOS7 WebView jwplayer和超链接无法正常工作

时间:2013-10-07 13:53:28

标签: html webview ios7 jwplayer

将xcode升级到最新版本5.0后,我的应用无法正常运行。

在我的应用程序中,有一个webview,它将加载jwplayer来播放视频,它在iOS5,6上运行完美,但不适用于iOS7。

之前有没有人遇到过这个问题?提前致谢

更新代码

 NSString *htmlString = @"<!DOCTYPE html><html><head><script src='http://54.246.122.18:8080/cvplay/public/javascripts/jwplayer.js' type='text/javascript' charset='utf-8'></script><script type='text/javascript'>jwplayer.key='MyKey';</script></head><body style='background:black;'><div style='width:320px;height:180px;margin:auto;position:relative;top:-18px;left:-8px;'><div id='stream'>CVplay</div></div><script type='text/javascript'>jwplayer('stream').setup({width:320,height:180,autostart: true,file: 'https://xxx.com/render/13807449869021017925092789.mp4',skin: 'roundster',modes: [{ type: 'html5',config: {file: 'https://xxx.com/render/13807449869021017925092789.mp4'}},{ type: 'download' }]});</script></body></html>";


[webView loadHTMLString:htmlString baseURL:nil];

1 个答案:

答案 0 :(得分:0)

我对一个拥有jwplayer的网站有同样的问题。当用户试图通过iOS7中的Facebook应用程序(嵌入在iOS应用程序中的浏览器,webView?)观看视频时,感觉有些东西阻止了玩家的用户输入。

在黑客攻击和削减一些JavaScript后,我们发现问题的原因是html5播放器中的视频元素。您可以通过在播放器完全加载后为视频元素设置宽度和高度为1来解决此问题:

jwplayer().onReady(function() {
  $('.jwvideo video')
    .width(1)
    .height(1);
});