Невозможно воспроизвести URL-адрес видео с помощью Android Webview - PullRequest
0 голосов
/ 18 апреля 2019

видео не может быть воспроизведено с помощью веб-браузера android studio, но при включении его можно воспроизвести

public class Sila3bFragment extends Fragment {

    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View mView = inflater.inflate(R.layout.fragment_tab2, container, false);

        final WebView mWb = (WebView) mView.findViewById(R.id.wv_Tab2);
        mWb.loadUrl("file:///android_asset/web/sila3/pagemaknaC.html");
        mWb.getSettings().setJavaScriptEnabled(true);

        return mView;
    }
}

1 Ответ

0 голосов
/ 18 апреля 2019
     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);
...