0

enter image description here WebSettings webSettings = HybridView.Settings; HybridView.SetWebViewClient(new MyWebViewClient(Context)); HybridView.SetWebChromeClient(new WebChromeClient());

                webSettings.JavaScriptEnabled = true;
                webSettings.AllowFileAccess = true;
                webSettings.LoadsImagesAutomatically = true;
                webSettings.JavaScriptCanOpenWindowsAutomatically = true;
                webSettings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.TextAutosizing);
                webSettings.DomStorageEnabled = true;

                HybridView.ClearCache(true);
                HybridView.Settings.LoadWithOverviewMode = true;
                HybridView.Settings.UseWideViewPort = true;
                HybridView.Settings.BuiltInZoomControls = true;
                HybridView.Settings.DisplayZoomControls = false;

                HybridView.CopyBackForwardList();
                HybridView.CanGoBackOrForward(0);

                string HTMLText = "<html><body>" + "<span style='font-size:150%;' style='color:black;'>" + ContentString + "<span>" + "</body></html>";
                HybridView.LoadData(HTMLText, "text/html", null);
  • Why is this labeled XML. XML is not the same as HTML. – jdweng Feb 17 '22 at 09:50
  • Does the image and video from local folder or remote url ? If just from local storage , here is a working sample you can have a try : https://stackoverflow.com/questions/14194890/playing-local-video-in-webview-on-android . – ColeX Feb 18 '22 at 05:36
  • @ColeX-MSFT Image and video from remote url API. Like this :
    [beetube-video]https://beetube.live/embed/7LYBZhnLjxZ6A15[/beetube-video]

    \"neymar-jr-biography-net-worth-awards-age-and-many-more-3\"

    – sophal thoeun Feb 20 '22 at 04:36
  • @jdweng Exactly I use Xamarin Android C# with XML file, I try to read the remote url with html string video, text and images and display in WebView. The results I got the images and text, but the video file not display in frame. It just show the video string file like this [beetube-video]beetube.live/embed/7LYBZhnLjxZ6A15[/beetube-video] . – sophal thoeun Feb 20 '22 at 04:51
  • Is video a Mime attachment? See : https://learn.microsoft.com/en-us/answers/questions/226004/how-to-play-audiovideo-in-webview-from-memorystrea.html – jdweng Feb 20 '22 at 10:48
  • Thanks @jdweng I found the solution for that. – sophal thoeun Feb 21 '22 at 08:01

0 Answers0