Sub PlayVideo(videoId As String)
Dim no As NativeObject = WebView1
no.RunMethod("setMediaPlaybackRequiresUserAction:", Array(False))
WebView1.LoadHtml($"<!DOCTYPE html><html>
<head>
<style>body{margin:0px 0px 0px 0px;}</style></head>
<body> <div id="player"></div>
<script> var tag = document.createElement('script');
tag.src = "https://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player; function onYouTubePlayerAPIReady()
{ player = new YT.Player('player', { width:'${100%x}', height:'${100%y}', videoId:'${videoId}', events: { 'onReady': onPlayerReady, } }); }
function onPlayerReady(event) { event.target.playVideo(); }
</script> </body> </html>"$)
End Sub