tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

file_mediaplayback_frame.html (483B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>Non-Autoplay page being used in Iframe</title>
      5 </head>
      6 <body>
      7 <video id="video" src="gizmo.mp4" loop></video>
      8 <script type="text/javascript">
      9 
     10 const video = document.getElementById("video");
     11 const w = window.opener || window.parent;
     12 
     13 window.onmessage = async event => {
     14  if (event.data == "play") {
     15    let rv = await video.play().then(() => true, () => false);
     16    w.postMessage(rv ? "played" : "blocked", "*");
     17  }
     18 }
     19 </script>
     20 </body>
     21 </html>