JSFiddle - React, Tailwind, and code Playground
by nikolya223
HTML
<script src="http://tanks.mail.ru/themes/default/js/jquery.rYouTube.min.js"></script>
<div id="video"></div>
CSS
.rYouTube__cont {
position: relative;
overflow: hidden;
}
.rYouTube__splash {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url('http://raketa.pro/wp-content/uploads/2013/03/image_header.png') 50% no-repeat;
}
.rYouTube__play {
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
width: 120px;
height: 90px;
margin: -45px 0 0 -60px;
cursor: pointer;
background: red;
border-radius: 30px;
}
.rYouTube__mute {
position: absolute;
z-index: 10;
top: 5px;
right: 5px;
width: 20px;
height: 20px;
background: lightgreen;
cursor: pointer;
border-radius: 10px;
}
.rYouTube__mute.mute {
background: green;
}
.rYouTube__volume {
position: absolute;
z-index: 10;
top: 30px;
right: 5px;
width: 20px;
height: 100px;
background: lightblue;
border-radius: 10px;
}
.rYouTube__volume-inner {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
background: blue;
border-radius: 10px;
}
.rYouTube__progress {
position: absolute;
z-index: 10;
bottom: 10px;
left: 10px;
right: 10px;
height: 20px;
background: orange;
border-radius: 10px;
}
.rYouTube__progress-inner {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: silver;
border-radius: 10px;
}
.rYouTube__cont.playing .rYouTube__splash, .rYouTube__cont.playing .rYouTube__play {
display: none;
}
JavaScript
$('#video').rYouTube({
video: {
id: '2LIKdh8qRT0',
width: 300,
mute: true,
volume: true,
progress: true
}
});