From c3712bfd779e9a1243b86454fcd02bb21114b93f Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Sat, 1 Nov 2025 09:10:47 -0400 Subject: [PATCH] Added some nullchecks to mediaHandler.js to quiet down stale handlers right after death. --- www/js/channel/mediaHandler.js | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/www/js/channel/mediaHandler.js b/www/js/channel/mediaHandler.js index b4792af..3dd11ae 100644 --- a/www/js/channel/mediaHandler.js +++ b/www/js/channel/mediaHandler.js @@ -470,35 +470,18 @@ class rawFileHandler extends rawFileBase{ //play video this.video.play(); - - /*/if we have an audio src - if(this.audio.src != ""){ - //Play it too - this.audio.play(); - }*/ } play(){ + super.play(); //play video this.video.play(); - - - /*/if we have a seperate audio track - if(this.audio.src != ""){ - //Play it too - this.audio.play(); - }*/ } pause(){ + super.pause(); //pause video this.video.pause(); - - /*/if we have a seperate audio track - if(this.audio.src != ""){ - //Pause it too - this.audio.pause(); - }*/ } sync(timestamp = this.lastTimestamp){ @@ -512,7 +495,7 @@ class rawFileHandler extends rawFileBase{ } //if we have a seperate audio track - if(this.audio != ""){ + if(this.audio != null && this.audio != ""){ //Re-sync it to the video, regardless if we synced video this.audio.currentTime = this.video.currentTime; } @@ -528,7 +511,7 @@ class rawFileHandler extends rawFileBase{ super.onSeek(event); //if we have a seperate audio track - if(this.audio != "" && this.video != null){ + if(this.audio != null && this.audio != "" && this.video != null){ //Set it's timestamp too this.audio.currentTime = this.video.currentTime; } @@ -539,7 +522,7 @@ class rawFileHandler extends rawFileBase{ super.onBuffer(event); //if we have a seperate audio track - if(this.audio != "" && this.video != null){ + if(this.audio != null && this.audio != "" && this.video != null){ //Set it's timestamp this.audio.currentTime = this.video.currentTime; //pause it @@ -553,7 +536,7 @@ class rawFileHandler extends rawFileBase{ super.onPause(event); //if we have a seperate audio track - if(this.audio != "" && this.video != null){ + if(this.audio != null && this.audio != "" && this.video != null){ //Set it's timestamp this.audio.currentTime = this.video.currentTime; //pause it @@ -564,7 +547,7 @@ class rawFileHandler extends rawFileBase{ onPlay(event){ //if we have a seperate audio track - if(this.audio != "" && this.video != null){ + if(this.audio != null && this.audio != "" && this.video != null){ //Set audio volume this.audio.volume = this.player.volume; //Set it's timestamp