0
我正在使用包含WKWebView加載html5文件的應用程序。其中一些文件包含應該在觸按播放按鈕上再現的.mp4視頻。WKWebView html5嵌入式視頻在模擬器上播放,但不在真實設備上播放
在模擬器中播放視頻沒有問題,但在真實設備中只能聽到聲音,而圖像僅在按下暫停按鈕時才能看到。
我用來加載與嵌入的視頻文件的index.html的代碼是:
let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let htmlTmp = documentsUrl.appendingPathComponent("data/index.html")
webview.loadFileURL(htmlTmp, allowingReadAccessTo: documentsUrl.appendingPathComponent("data/"))
任何可能的解決方案?
謝謝。
我試過這個,但沒有工作。在大量的谷歌搜索之後,它似乎是iOS 10.2上開始發生的事情。 – RFG