I am making a very simple web service for uploading photos and videos. I want to show thumbnails and upload progress for selected files on the web page. I create thumbnails like described here. For photos it work great, but not for videos.
When user uploads video, I can get access to videoHeight
and videoWidth
attributes, basically it is all I need for thumbnail creation. But these values not always represent real height and width for vertical video. Here is an example (vertical video - the height value have to be bigger):
vertical video uploaded to chrome:
videoHeight: 720 videoWidth: 1280
the same vertical video uploaded to edge browser:
videoHeight: 1280 videoWidth: 720
You see, in the first situation dimensions are incorrect, what leads to shrinking and stretching video in the preview.
Some videos might have such attribute like Rotation
, and I think that edge somehow understands it, but not chrome. My question is: is it possible to detect whether video has vertical (portrait) or horizontal (landscape) orientation in browsers, other than edge?