androidandroid-webviewvimeo-android

Displaying a vimeo video in Android's WebView shows a white blank screen


I'm trying to display a video from vimeo in an Android WebView inside a Dialog.

Here is my code:

Dialog dialog = new Dialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
dialog.setContentView(R.layout.dialog_help);

WebView webView = dialog.findViewById(R.id.webview_help_video);

webView.setWebViewClient(new WebViewClient() {

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return false;
        }
    });

WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("https://player.vimeo.com/video/332293586");

dialog.setCanceledOnTouchOutside(true);
dialog.show();

When hitting vimeo's Play button, the view becomes blank.

Sound plays ok though.


Solution

  • I fixed the problem after adding the following line to the application attribute list, in my app manifest :

    android:hardwareAccelerated="true"