diff --git a/www/js/channel/mediaHandler.js b/www/js/channel/mediaHandler.js index 1483d08..aaed2bc 100644 --- a/www/js/channel/mediaHandler.js +++ b/www/js/channel/mediaHandler.js @@ -30,9 +30,6 @@ class mediaHandler{ //Set last received timestamp to 0 this.lastTimestamp = 0; - //Set volume - this.volume = 1; - //Ingest media object from server this.startMedia(media); } @@ -149,6 +146,7 @@ class rawFileBase extends mediaHandler{ defineListeners(){ //Resize to aspect on metadata load this.video.addEventListener('loadedmetadata', this.onMetadataLoad.bind(this)); + this.video.addEventListener('volumechange', this.onVolumeChange.bind(this)); } buildPlayer(){ @@ -211,7 +209,7 @@ class rawFileBase extends mediaHandler{ onVolumeChange(event){ //Pull volume from video - this.volume = this.video.volume; + this.player.volume = this.video.volume; } } @@ -270,7 +268,7 @@ class rawFileHandler extends rawFileBase{ this.video.src = this.nowPlaying.id; //Set video volume - this.video.volume = this.volume; + this.video.volume = this.player.volume; //Set video title this.setVideoTitle(this.nowPlaying.title); diff --git a/www/js/channel/player.js b/www/js/channel/player.js index 150bab0..750a45e 100644 --- a/www/js/channel/player.js +++ b/www/js/channel/player.js @@ -43,6 +43,7 @@ class player{ //Numbers this.syncTolerance = 0.4; this.syncDelta = 6; + this.volume = 1; //run setup functions this.setupInput();