Commit bdfa793a authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Juliusz Chroboczek

Add play button to video custom controls

If autoplay is not working on browser, user can play the video with this button
parent 6b4d3512
......@@ -525,6 +525,10 @@ textarea.form-reply {
text-align: center;
}
.video-controls .video-play {
font-size: 0.85em;
}
.video-controls span.disabled, .video-controls span.disabled:hover, .top-video-controls span.disabled:hover{
opacity: .2;
color: #c8c8c8
......
......@@ -229,6 +229,9 @@
<div id="videocontrols-template" class="invisible">
<div class="video-controls vc-overlay">
<div class="controls-button controls-left">
<span class="video-play" title="Play video">
<i class="fas fa-play"></i>
</span>
<span class="volume" title="Volume">
<i class="fas fa-volume-up volume-mute" aria-hidden="true"></i>
<input class="volume-slider" type="range" max="100" value="100" min="0" step="5" >
......
......@@ -1166,6 +1166,14 @@ function setVolumeButton(muted, button, slider) {
* @param {HTMLElement} container
*/
function registerControlHandlers(media, container) {
let play = getVideoButton(container, 'video-play');
if(play) {
play.onclick = function(event) {
event.preventDefault();
media.play();
};
}
let volume = getVideoButton(container, 'volume');
if (volume) {
volume.onclick = function(event) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment