commit 00231eb15bb00828f6fac43abcc079225e750696
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Nov 17 13:42:44 2025 +0100

    fix for YouTube tightening its policy

diff --git a/src/main/java/org/distorted/tutorials/TutorialWebView.java b/src/main/java/org/distorted/tutorials/TutorialWebView.java
index 1b3ab5ad..059c6a55 100644
--- a/src/main/java/org/distorted/tutorials/TutorialWebView.java
+++ b/src/main/java/org/distorted/tutorials/TutorialWebView.java
@@ -10,6 +10,7 @@
 package org.distorted.tutorials;
 
 import android.annotation.SuppressLint;
+import android.webkit.WebSettings;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
 
@@ -27,16 +28,13 @@ public class TutorialWebView
       {
       mWebView = webview;
       mWebView.setBackgroundColor(0);
-      mWebView.getSettings().setJavaScriptEnabled(true);
 
-      mWebView.setWebViewClient(new WebViewClient()
-        {
-        @Override
-        public boolean shouldOverrideUrlLoading(WebView view, String url)
-          {
-          return false;
-          }
-        });
+      WebSettings ws = mWebView.getSettings();
+      ws.setJavaScriptEnabled(true);
+      ws.setDomStorageEnabled(true);
+      ws.setMediaPlaybackRequiresUserGesture(false);
+
+      mWebView.setWebViewClient(new WebViewClient());
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -45,10 +43,22 @@ public class TutorialWebView
       {
       mUrl = url;
 
-      String data1 = "<html><body><iframe width=\"100%\" height=\"100%\" src=\"";
-      String data2 = "\" frameborder=\"0\" allowfullscreen></iframe></body></html>";
-
-      mWebView.loadData(data1+url+data2, "text/html", "UTF-8");
+      String baseUrl = "https://distorted.org/";
+
+      String html =
+              "<html>" +
+              "<body style='margin:0;padding:0'>" +
+              "<iframe " +
+              "width='100%' height='100%' " +
+              "src='" + url + "' " +
+              "frameborder='0' " +
+              "allow='autoplay; encrypted-media' " +
+              "referrerpolicy='strict-origin-when-cross-origin' " +
+              "allowfullscreen>" +
+              "</iframe>" +
+              "</body></html>";
+
+      mWebView.loadDataWithBaseURL(baseUrl, html,"text/html", "UTF-8",null);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
