html
  • webview
  • ios7
  • jwplayer
  • 2013-10-07 78 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

    不適用於我。 –

    相關問題