无法使用Android Webview播放视频网址

时间:2019-04-18 03:09:19

标签: android webview video-streaming

无法使用webview android studio播放视频,但是在取消静音时可以播放

const link = element(...);

const beforeText = await link.getText();

await link.click()

const afterText = await link.getText();

expect(beforeText).toEqual(afterText);

1 个答案:

答案 0 :(得分:0)

     WebSettings settings = mWb.getSettings();
        settings.setLoadWithOverviewMode(true);
        settings.setAllowFileAccess(true);
        settings.setJavaScriptEnabled(true);
        settings.setDefaultTextEncodingName("utf-8");
        settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
        settings.setPluginState(WebSettings.PluginState.ON_DEMAND);
        mWb.loadDataWithBaseURL("file:///android_asset/", "assets read string data", "text/html", "UTF-8", null);