JSFiddle - React, Tailwind, and code Playground
by skeurentjes
HTML
<div id="videopart">
<video id="myVideo" width="320" height="176" controls muted autoplay="autoplay">
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<button onclick="toggleMute();" type="button" id="mute">Toggle sound</button>
</div>
CSS
body {
margin: 0px;
padding: 0px;
}
#mute {
position: absolute;
margin-left: auto;
margin-right: 20px;
}
#videopart {
position: relative;
margin: 0 !important;
top: 0;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: hidden;
}
#myVideo {
margin: auto;
width: 100%;
height: auto;
}
#mute {
position: absolute;
right: 20px;
bottom: 20px;
z-index: 10;
}