Skip to content

Instantly share code, notes, and snippets.

@aswen
Last active April 18, 2020 22:36
Show Gist options
  • Save aswen/166a359d728240cbbc2808cbefda8b0f to your computer and use it in GitHub Desktop.
Save aswen/166a359d728240cbbc2808cbefda8b0f to your computer and use it in GitHub Desktop.
-var title     = "Timendus' latest video";
-var channelId = "Timendus";
-var domain    = "timendus.github.io";
+var title     = "De Gele Bus";
+//var channelId = "UC5LdPU7qdeuvjM-avN-HQJQ";
+var videoId = "CtTrLKfQnJM";
+var domain    = "https://degelebus.nl/laatste";
 
 // Optional
 var showYouTubeLogo = false; // Does nothing if controls are hidden
 var showSubtitles   = true;
-var showControls    = false;
+var showControls    = true;
 
 /** CODE **/
 
 window.onload = function() {
   document.title = title;
-  document.getElementById('container').innerHTML = '<iframe width="100%" height="100%" src="https://www.youtube-nocookie.com/embed?listType=user_uploads&list=' + channelId + '&cc_load_policy=' + (showSubtitles ? '1' : '0') + '&controls=' + (showControls ? '1' : '0') + '&rel=0&autoplay=1&origin=' + domain + '&modestbranding=' + (showYouTubeLogo ? '0' : '1') + '" frameborder="0" allow="autoplay; fullscreen" allowautoplay allowfullscreen></iframe>';
+  document.getElementById('container').innerHTML = '<iframe id="player" width="100%" height="100%" src="https://www.youtube-nocookie.com/embed/' + videoId + '?enablejsapi=1&cc_load_policy=' + (showSubtitles ? '1' : '0') + '&controls=' + (showControls ? '1' : '0') + '&rel=0&autoplay=1&origin=' + domain + '&modestbranding=' + (showYouTubeLogo ? '0' : '1') + '" frameborder="0" allow="autoplay; fullscreen" allowautoplay allowfullscreen></iframe>';
 };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment