Added some nullchecks to mediaHandler.js to quiet down stale handlers right after death.

This commit is contained in:
rainbow napkin 2025-11-01 09:10:47 -04:00
parent 366766d0a3
commit c3712bfd77

View file

@ -470,35 +470,18 @@ class rawFileHandler extends rawFileBase{
//play video //play video
this.video.play(); this.video.play();
/*/if we have an audio src
if(this.audio.src != ""){
//Play it too
this.audio.play();
}*/
} }
play(){ play(){
super.play();
//play video //play video
this.video.play(); this.video.play();
/*/if we have a seperate audio track
if(this.audio.src != ""){
//Play it too
this.audio.play();
}*/
} }
pause(){ pause(){
super.pause();
//pause video //pause video
this.video.pause(); this.video.pause();
/*/if we have a seperate audio track
if(this.audio.src != ""){
//Pause it too
this.audio.pause();
}*/
} }
sync(timestamp = this.lastTimestamp){ sync(timestamp = this.lastTimestamp){
@ -512,7 +495,7 @@ class rawFileHandler extends rawFileBase{
} }
//if we have a seperate audio track //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 //Re-sync it to the video, regardless if we synced video
this.audio.currentTime = this.video.currentTime; this.audio.currentTime = this.video.currentTime;
} }
@ -528,7 +511,7 @@ class rawFileHandler extends rawFileBase{
super.onSeek(event); super.onSeek(event);
//if we have a seperate audio track //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 //Set it's timestamp too
this.audio.currentTime = this.video.currentTime; this.audio.currentTime = this.video.currentTime;
} }
@ -539,7 +522,7 @@ class rawFileHandler extends rawFileBase{
super.onBuffer(event); super.onBuffer(event);
//if we have a seperate audio track //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 //Set it's timestamp
this.audio.currentTime = this.video.currentTime; this.audio.currentTime = this.video.currentTime;
//pause it //pause it
@ -553,7 +536,7 @@ class rawFileHandler extends rawFileBase{
super.onPause(event); super.onPause(event);
//if we have a seperate audio track //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 //Set it's timestamp
this.audio.currentTime = this.video.currentTime; this.audio.currentTime = this.video.currentTime;
//pause it //pause it
@ -564,7 +547,7 @@ class rawFileHandler extends rawFileBase{
onPlay(event){ onPlay(event){
//if we have a seperate audio track //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 //Set audio volume
this.audio.volume = this.player.volume; this.audio.volume = this.player.volume;
//Set it's timestamp //Set it's timestamp