Created
November 25, 2019 20:24
-
-
Save marysomerville/f5b0770a71287df754390e4c9d4e583b to your computer and use it in GitHub Desktop.
Video load
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
introVid = '/assets/media/intro-video-sequence.mp4'; | |
lieVid = '/assets/media/lygamaelir.mp4'; | |
handVid = '/assets/media/handloop.mp4'; | |
var reqIntro = new XMLHttpRequest(); | |
reqIntro.open('GET', introVid, true); | |
reqIntro.responseType = 'blob'; | |
reqIntro.onload = function(e) { | |
if (this.status === 200) { | |
var videoBlob = this.response; | |
var vid = URL.createObjectURL(videoBlob); // IE10+ | |
var videoIntro = document.getElementById('video-2'); | |
videoIntro.src = vid; | |
//console.log("got intro video"); | |
} | |
} | |
reqIntro.onerror = function() { | |
} | |
reqIntro.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment