@@ -70,6 +70,9 @@ class Controller {
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
const volume = document.getElementById("volume");
|
||||
volume.addEventListener("input", this.view.videoPlayer.updateVolume);
|
||||
|
||||
document.addEventListener(
|
||||
"keyup",
|
||||
function (e) {
|
||||
|
||||
11
js/video.js
11
js/video.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user