Skip to content

Instantly share code, notes, and snippets.

@marcosbozzani
Created September 12, 2020 19:09
Show Gist options
  • Select an option

  • Save marcosbozzani/9d894993cced6d6173141e6094f5c08c to your computer and use it in GitHub Desktop.

Select an option

Save marcosbozzani/9d894993cced6d6173141e6094f5c08c to your computer and use it in GitHub Desktop.
moodle: video-js youtube view only
// moodle/media/player/videojs/classes/plugin.php
var styles = document.createElement("style");
styles.innerHTML = "\
.vjs-youtube .vjs-tech {\
pointer-events: none !important; \
}\
.vjs-youtube .vjs-big-play-button { \
position: absolute; \
left: 50%; \
top: 50%; \
transform: translate(-50%, -50%); \
transition: none;\
}\
.vjs-youtube-mobile .vjs-big-play-button {\
display: block;\
}\
.vjs-controls-disabled .vjs-big-play-button, \
.vjs-has-started .vjs-big-play-button, \
.vjs-using-native-controls .vjs-big-play-button, \
.vjs-error .vjs-big-play-button {\
display: none;\
}\
";
(document.head || document.getElementsByTagName('head')[0]).appendChild(styles);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment