So I have a video page where I embed a vimeo video. The trouble is, the aspect ratio is often wrong because I don't set the width and height. Leaving me with black bars on the video. I only pass in the vimeo ID dynamically, so I don't set a width and height per video.
Dynamic video ID like this:
<iframe src="http://player.vimeo.com/video/<?php echo $videoID; ?>?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0"></iframe>
So, my question is, is there a way I can detect what the aspect ratio of the video should be?
I know there are lots of plugins that can help you maintain an aspect ratio for fluid widths, such as; -http://fitvidsjs.com/
and you can achieve it with javascript as described on css-tricks: -http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
-- but these only work if you set the correct aspect ratio to begin with using the width and height attributes.
Most new vimeo videos seem to be width="400" height="225", but my website deals with some older videos that don't share this ratio, so you get black pipes either along the top and bottom of the video or down the sides.
It is these black pipes that I'm trying to remove on every video.
Appreciate any suggestions,
Alsweet