I have a Vimeo video on a page using universal embed code:
<div class="video"> <iframe src="http://player.vimeo.com/video/VIDEO_ID" width="100%" height="100%" frameborder="0"></iframe> </div>
I use the Vimeo JavaScript API ( http://vimeo.com/api/docs/player-js ) to add a class to the video
div (which doubles the div) when the video starts playing, and when the video is paused or finished, the class will be deleted. dropping the size of the video player to its original size.
This works as expected on a desktop / laptop (Firefox), but on an Android phone, the iframe (as soon as it doubles its size) does not return to its previous size (this is a percentage, so it must adapt to its video
), which causes the iframe to overlap its parent div.
At first, I thought it was 100% width and height of the iframe, so I specified a fixed width and height for the iframe using $('#video1').attr('width', 400);
when the video was stopped, but the iframe remained unchanged (it remained twice as large).
Does anyone have any idea why Android does this and how can I get the iframe to resize?
source share