Added persistant volume.

This commit is contained in:
rainbow napkin 2025-05-04 17:17:20 -04:00
parent b253f817f4
commit 2d5afc23d7
2 changed files with 4 additions and 5 deletions

View file

@ -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);

View file

@ -43,6 +43,7 @@ class player{
//Numbers
this.syncTolerance = 0.4;
this.syncDelta = 6;
this.volume = 1;
//run setup functions
this.setupInput();