Video Size

by dustinkerstein

CSS

video {
  margin: 0;
  width: 100%;
  height: 100%;
}

JavaScript

var src = "https://files.panomoments.com/uhd1frame.mp4"
var video = document.createElement("video");

document.body.appendChild(video);
video.preload = 'none';
video.autoplay = true;
video.muted = true;
video.loop = true;

fetch(src).then(function(response) {
  response.blob().then(function(myBlob) {
    video.src = window.URL.createObjectURL(myBlob);
  });
});

video.addEventListener( "loadedmetadata", function (e) {
  console.log("Video width: " + this.videoWidth + " height: " + this.videoHeight)
}, false );