title: How to detect mp4 video orientation through Javascript
body: <p>I'm using HTML5 video tag to link to various mp4 videos on Amazon S3 for playback.  However, all the videos are played back in landscape even though some are recorded in portrait (from iOS devices).</p>
  
  <p>When I download the actual videos and play them with QuickTime, they are played with the correct orientation.</p>
  
  <p>My question is is there a way to detect mp4 video orientation using Javascript and play it with the correct orientation?  I'm using AngularJS as well, and I couldn't find any directives that relates to this.</p>
  
  <p>I did find</p>
  
  <p><a href="https://hacks.mozilla.org/2011/01/zooming-and-rotating-for-video-in-html5-and-css3/" rel="nofollow">https://hacks.mozilla.org/2011/01/zooming-and-rotating-for-video-in-html5-and-css3/</a></p>
  
  <p>which explained how to rotate a video, but not on detection.</p>
  
  <p>Thanks for the help!</p>