html
  • webview
  • ios7
  • jwplayer
  • 2013-10-07 80 views 1 likes 
    1

    将xcode升级到最新版本5.0后,我的应用程序无法正常工作。iOS7 WebView jwplayer和超链接不工作

    在我的应用程序中,有一个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]; 
    
    +0

    您是否有示例可以共享?它只是在移动Safari中作为网页工作,还是只在应用程序中打破? – emaxsaun

    +0

    嗨,Ethan,我刚刚用我的代码更新了我的问题。仅供参考,它在iOS5,6上完美运行,但不支持iOS7。这只是播放按钮不能被点击。 –

    +0

    您是否仅在应用程序中遇到问题,或者在iOS7下是否也在移动Safari中突然出现问题? – emaxsaun

    回答

    0

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

    在对一些JavaScript进行黑客入侵和削减后,我们发现导致问题的原因是html5播放器中的视频元素。您可以通过在播放器满载后将视频元素的宽度和高度设置为1来解决此问题:

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

    不适用于我。 –

    相关问题