1

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?

Ilia
  • 147
  • 1
  • 4
  • 18
  • To me, that looks like a bug in chrome where it doesn't respect video's size, on my comp, it even displays it in the wrong format (stretching the aspect ratio so the height fits the width...). My FF is just good and outputs the correct `videoWidth` and `videoHeight` values. My Safari is ok too. So if this is confirmed, a solution would be to open a bug report (if there isn't one already, actually there are already a lot of similar ones, but couldn't find a perfect fit right now) – Kaiido Aug 30 '16 at 08:42
  • @Kaiido, yeah I have tried to use firefox, but it rotates vertical video to make it horizontal and I don't know how to detect this operation to rotate it back. – Ilia Aug 30 '16 at 09:22
  • On my FF on mac it works just good with my sample videos... – Kaiido Aug 30 '16 at 09:46

0 Answers0