I am using videojs to play html5 videos, of varying dimensions. Is it possible to detect the height/width of a video file using jQuery (or another scripting language for th
Yes, you can get the videoWidth and videoHeight properties - they are downloaded with the video's metadata, so be sure not to use preload="none" with your video element as it prevents metadata from being downloaded until someone tries to play the video. Here's how to do it with jquery:
$(function(){
$('video').bind('loadedmetadata', function(){
var rawWidth = $(this).prop('videoWidth');
var rawHeight = $(this).prop('videoHeight');
});
});