Created
September 19, 2016 14:09
-
-
Save bennettscience/c5611aa6f180ef363819f51fc72550ac to your computer and use it in GitHub Desktop.
JS Source files for the church mission wall project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Listen for user input and display a prompt if none for 30 seconds. | |
$(document).ready(function() { | |
var i = null; | |
$("#body-wrap").mousemove(function() { | |
clearTimeout(i); | |
$("#overlay").fadeOut(); | |
i = setTimeout(function() { | |
$("#overlay").fadeIn(); | |
}, 20000); | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Controls video display and playback | |
$(document).ready(function() { | |
// Listen for a click on a mission & play the video | |
$('.cell').on('click', function() { | |
var element = this.getElementsByTagName('video'); | |
var m = element[0].getAttribute('id'); | |
console.log(m); | |
var v = document.getElementById(m); | |
if (v.webkitRequestFullscreen) { | |
v.className = ""; | |
v.webkitRequestFullscreen(); | |
} | |
$("#" + m).on("ended", function() { | |
this.webkitExitFullscreen(); | |
this.className = "hide"; | |
}); | |
// Detect fullscreen entered or exited for play state | |
$("#" + m).bind('webkitfullscreenchange', function(e) { | |
var state = document.webkitIsFullScreen; | |
var event = state ? 'FullscreenOn' : 'FullscreenOff'; | |
if (event == 'FullscreenOn') { | |
console.log('entered fullscreen, playing...') | |
setTimeout(function() {v.play()},2000); | |
} else { | |
console.log('exited fullscreen, pausing...') | |
this.className = "hide"; | |
v.pause(); | |
} | |
}); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment