From 34f8895469a9b020244945b72a0a5a0b686b316c Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Fri, 11 Feb 2022 20:04:45 +0400 Subject: [PATCH] Fix clearing chat on destroy --- .env | 4 ++-- src/lib/mediaPlayer.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.env b/.env index a9bfab95..57880ccf 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ API_ID=1025907 API_HASH=452b0359b988148995f22ff0f4229750 VERSION=1.1.0 -VERSION_FULL=1.1.0 (98) -BUILD=98 +VERSION_FULL=1.1.0 (99) +BUILD=99 diff --git a/src/lib/mediaPlayer.ts b/src/lib/mediaPlayer.ts index 5597a362..1c5da7d0 100644 --- a/src/lib/mediaPlayer.ts +++ b/src/lib/mediaPlayer.ts @@ -175,11 +175,13 @@ export class MediaProgressLine extends RangeSelector { public removeListeners() { super.removeListeners(); - this.media.removeEventListener('loadeddata', this.onLoadedData); - this.media.removeEventListener('ended', this.onEnded); - this.media.removeEventListener('play', this.onPlay); - this.media.removeEventListener('timeupdate', this.onTimeUpdate); - this.streamable && this.media.removeEventListener('progress', this.onProgress); + if(this.media) { + this.media.removeEventListener('loadeddata', this.onLoadedData); + this.media.removeEventListener('ended', this.onEnded); + this.media.removeEventListener('play', this.onPlay); + this.media.removeEventListener('timeupdate', this.onTimeUpdate); + this.streamable && this.media.removeEventListener('progress', this.onProgress); + } if(this.progressRAF) { window.cancelAnimationFrame(this.progressRAF);