From 6cf0434aa8e539504bf1ba58f379f1fbe830190e Mon Sep 17 00:00:00 2001 From: Elie Habib Date: Thu, 26 Feb 2026 16:07:54 +0400 Subject: [PATCH] fix(live-news): destroy player before showing offline/error message (#347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit showOfflineMessage() and showEmbedError() replaced innerHTML without cleaning up this.player, so initializePlayer() bailed early on the next channel switch — leaving a black screen. destroyPlayer() is idempotent so the onError path won't double-destroy. Co-authored-by: N Cho-chin --- src/components/LiveNewsPanel.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/LiveNewsPanel.ts b/src/components/LiveNewsPanel.ts index 268b99a7e..49b981368 100644 --- a/src/components/LiveNewsPanel.ts +++ b/src/components/LiveNewsPanel.ts @@ -736,6 +736,7 @@ export class LiveNewsPanel extends Panel { } private showOfflineMessage(channel: LiveChannel): void { + this.destroyPlayer(); this.content.innerHTML = `
📺
@@ -746,6 +747,7 @@ export class LiveNewsPanel extends Panel { } private showEmbedError(channel: LiveChannel, errorCode: number): void { + this.destroyPlayer(); const watchUrl = channel.videoId ? `https://www.youtube.com/watch?v=${encodeURIComponent(channel.videoId)}` : `https://www.youtube.com/${channel.handle}`;