I'm attempting to give a decorative border to a flexible embedded video.
I've experimented with two different techniques to display the video:
1.
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ"></iframe>
</div>
2.
<div style="position: relative; width: 100%; padding-bottom: 56.25%;" class="text-center">
<iframe allowfullscreen="" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" frameborder="0" style="position: absolute; left: 0%; top: 0%; width: 100%; height: 100%"></iframe>
</div>
I've attempted to add a border to both methods, using:
a.
border:3px solid #EEE;
b. (variations of the below e.g. different width/height values etc, and where the parent div had a background color, which matches the border color)
<iframe style="left: 5px; top: 5px; width: 100%; height: 100% ... >...</iframe>
There is a consistent issue when applying the border, for all methods: the video either appears too enlarged or too compressed within the space it occupies. Sometimes the video is zoomed in, or it ends up too small causing black borders to appear either vertically or horizontally based on whether the width or height is insufficient. Check the image below for reference.
https://i.sstatic.net/G9rrB.jpg
I've tried adjusting various values in an attempt to eliminate the black border, like slightly increasing the outer-div's height padding, shifting the iframe by adjusting the left/right values, and reducing its size with aspect ratio intact. However, I am hoping for a simpler solution.
Is there a way to add a border of any size to a responsive video without encountering black borders or the need for zooming adjustments?