0
        var webView = (WebView)FindViewById(Resource.Id.JackKnifeVid);
        WebSettings settings = webView.Settings;
        settings.JavaScriptEnabled = true;
        webView.SetWebViewClient(new WebViewClient());
        webView.LoadUrl("https://www.youtube.com/watch?v=CWOZyf8kaH0");

It only plays a video but showing a black screen.

rence
  • 1
  • 1
  • Can you try this approach: https://stackoverflow.com/questions/7422427/android-webview-slow ? The reason you are seeing black screen, could be because of low webView performance – Ayush May 22 '21 at 11:58
  • I checked the same code code with yours on Android 9.0. It works well. Could you provide more details for me to reproduce? – Wendy Zang - MSFT May 24 '21 at 05:46

1 Answers1

0

Hi my friend use this before load content

webView.setWebChromeClient(new WebChromeClient() {});

and you can see this similar question

Mahdi Zareei
  • 1,299
  • 11
  • 18
  • Its going directly to youtube app – rence May 22 '21 at 08:21
  • thats why i used setWebViewClient it stops going to youtube app, but then its black screen – rence May 22 '21 at 08:23
  • var webView = (WebView)FindViewById(Resource.Id.JackKnifeVid); WebSettings settings = webView.Settings; settings.JavaScriptEnabled = true; webView.SetWebViewClient(new WebViewClient()); webView.setWebChromeClient(new WebChromeClient() {}); webView.LoadUrl("https://www.youtube.com/watch?v=CWOZyf8kaH0"); – Mahdi Zareei May 22 '21 at 08:46
  • its now blank white HAHAHA – rence May 22 '21 at 09:00
  • XD, I posted another answer please check it – Mahdi Zareei May 23 '21 at 07:36