Youtube 自動(dòng)播放標(biāo)簽在 Android Webview iframe 中不起作用。如何去除cc標(biāo)簽?HTML 需要在 webview 中加載:<!DOCTYPE html><html> <style> .center{ position: absolute; margin: auto auto; right: 0; left: 0; bottom: 0; top: 0; } </style> <body style="background:#000"> <iframe id="videoContainer" class="center" width="100%" height="300" src="https://www.youtube.com/embed/5jnqWIlaLyA?rel=0&controls=1&showinfo=0&autoplay=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen> </iframe> </body></html>在網(wǎng)站上工作的相同代碼。內(nèi)容變量保存上面提到的 html。當(dāng)前的安卓代碼: mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setAppCacheEnabled(false); mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); mWebView.getSettings().setMediaPlaybackRequiresUserGesture(false); view.loadDataWithBaseURL(null, content, "text/html", "utf8", view.getUrl());
在 Android Webview 中自動(dòng)播放 Youtube
慕田峪4524236
2021-09-29 10:43:34