JSFiddle - React, Tailwind, and code Playground
HTML
<video id='video' height='100px'>
<source src=http://techslides.com/demos/sample-videos/small.webm type=video/webm>
<source src=http://techslides.com/demos/sample-videos/small.ogv type=video/ogg>
<source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
<source src=http://techslides.com/demos/sample-videos/small.3gp type=video/3gp>
</video>
<p id='label'> </p>
<button onClick="compute()">Compute</button>
CSS
body {margin:0; padding:0px;}
JavaScript
window.onload = function() {
compute();
};
document.getElementById("video").onloadedmetadata = function (e) {
compute()
};
function compute() {
var video = document.getElementById('video');
var width = video.videoWidth;
document.getElementById("label").innerHTML=width;
};