Skip to content

Instantly share code, notes, and snippets.

@marysomerville
Created November 25, 2019 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marysomerville/f5b0770a71287df754390e4c9d4e583b to your computer and use it in GitHub Desktop.
Save marysomerville/f5b0770a71287df754390e4c9d4e583b to your computer and use it in GitHub Desktop.
Video load
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