Ejemplo n.º 1
0
        /// <summary>
        /// Loads only the YouTube player removing all kinds of distractions
        /// </summary>
        /// <param name="url"></param>
        private void LoadYoutubeMode(string url)
        {
            // convert url to youtube embed
            url = url.Replace("watch?v=", "embed/");

            MainBrowser.LoadHtml($@"
<!DOCTYPE html>
<html>
  <body style=""overflow: hidden;"">
    <iframe id=""vid"" src=""{url}"" frameborder=""0""></iframe>

    <script type=""text/javascript"">
        var el = document.getElementById(""vid"");
        el.style.width=window.innerWidth-15+'px';
        el.style.height=window.innerHeight-15+'px';
    </script>
  </body>
</html>");
        }