I´m trying to put a video inside an image that appears like a tv. I wanted to be responsive and in the center of the screen. My attempt puts the video below the image and I can´t play it. ALready tried to mess with the z-index attribute but no luck.
Note: using Bootstrap 4
<style>
.video-container {
position: relative;
overflow: hidden;
}
.tv img {
position: absolute;
z-index: -10;
}
</style>
<script>
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('yt', {
height: '100%',
width: '100%',
videoId: 'WMn1_DAIpIs',
playerVars: { 'autoplay': 1, 'controls': 0, 'showinfo': 0 },
events: {
'onReady': onPlayerReady, // function when the player is ready
'onStateChange': onPlayerStateChange // function called when the player changes state (playing, stoped, paused, etc.)
}
});
}
</script>
<div class="row align-items-center">
<div class="col">
<div class="video-container ">
<img src="src/images/tv31.png" class="img-fluid">
<div class="tv" id=yt></div>
</div>
</div>
</div>
</div>