Přidání ovládání hlasitosi

closes #1
This commit is contained in:
2021-01-31 02:52:29 +01:00
parent b3836d47a6
commit 426fd2bf96
4 changed files with 80 additions and 3 deletions

View File

@@ -46,6 +46,17 @@ class VideoPlayer {
console.log("here");
}
}
updateVolume() {
const volume = document.getElementById("volume");
const volumeBar = document.getElementById("volume-bar-value");
if (video.muted) {
video.muted = false;
}
video.volume = volume.value / 100;
volumeBar.style.width = volume.value + "%";
}
// Play pause
togglePlay() {
if (this.video.paused || this.video.ended) {