Reputation: 453
I am using an iframe
tag to play a video, I extended the iframe
full width
and height
of the parent div
, like this :
But as you can see the video won't perfectly fit in the iframe
.
Is there any way to extend the video (like object-fit
does for images) or adapt the iframe
to the size of the video ?
Using CSS or JavaScript (preference using CSS).
Upvotes: 0
Views: 760
Reputation: 465
you need 2 separate pages: try this:
page 1
<iframe width="450" height="260" src='page2.html'>
</iframe>
page 2
<video width="420" controls>
<source src="movie.mp4" type="video/mp4">
</video>
that way you can fit them together, and make sure width and height of iframe are about 30px more than video itself
Upvotes: 1