Specifications:
- It is mandatory for the iframe to be enclosed within a div container as shown in the code below.
- The container should have the flexibility to adjust to any valid width and height using the vw and vh viewport units. Check the code provided below.
- The width and height must be defined in vw and vh units.
- The static video preview image should not be cropped at any cost.
- Avoid black bars above and below the static video preview image (letterboxing).
- No black bars on the sides of the static video preview image (pillarboxing) either.
- Utilize maximum space inside the containing div for the static video preview image.
- Maintain a constant aspect ratio of 16:9 for the static video preview image.
- Prevent the appearance of scrollbars.
- Center the static video preview image both vertically and horizontally inside its containing div.
- Implement Responsive Web Design principles.
All the above requirements should be met when resizing the browser or viewport.
HTML:
<div class="container">
<iframe></iframe>
</div>
CSS:
.container {
width:90vw;
height:50vh;
}