Skip to content

Instantly share code, notes, and snippets.

@iheart2code
Created August 18, 2014 22:12
Show Gist options
  • Save iheart2code/a855795d9aacfe23a9e2 to your computer and use it in GitHub Desktop.
Save iheart2code/a855795d9aacfe23a9e2 to your computer and use it in GitHub Desktop.
Plug.dj Non-crappy UX
// credit
// Most of this is copied from https://github.com/WouterG/PlugDJ-Development/blob/master/Fullscreen-Video.js
// source
(function(){
function fullVideo() {
//select the first element inside '#playback'
//and the first element in '#playback-container'
$('#playback:first, #playback-container:first')
//modify the css in all selected elements at the same time
.css("left", "0px")
.css("height", "100%")
.css("width", "100%");
$('#room:first')
.css("width", "100%")
.css("background-color", "black");
$('#audience:first, #dj-booth:first, #chat:first').css("display", "none");
}
fullVideo();
window.onresize = fullVideo;
setInterval(function() {
if ($('#playback-container')[0].style.width != '100%') {
fullVideo();
}
}, 500);
})();
// minified
(function(){function s(){$("#playback:first, #playback-container:first").css("left","0px").css("height","100%").css("width","100%"),$("#room:first").css("width","100%").css("background-color","black"),$("#audience:first, #dj-booth:first, #chat:first").css("display","none")}s(),window.onresize=s,setInterval(function(){"100%"!=$("#playback-container")[0].style.width&&s()},500)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment