diff --git a/src/components/ha-hls-player.ts b/src/components/ha-hls-player.ts index 1985605323..d621e79d80 100644 --- a/src/components/ha-hls-player.ts +++ b/src/components/ha-hls-player.ts @@ -98,6 +98,11 @@ class HaHLSPlayer extends LitElement { const Hls: typeof HlsType = (await import("hls.js/dist/hls.light.min")) .default; + + if (!this.isConnected) { + return; + } + let hlsSupported = Hls.isSupported(); if (!hlsSupported) { @@ -115,6 +120,10 @@ class HaHLSPlayer extends LitElement { const useExoPlayer = await useExoPlayerPromise; const masterPlaylist = await (await masterPlaylistPromise).text(); + if (!this.isConnected) { + return; + } + // Parse playlist assuming it is a master playlist. Match group 1 is whether hevc, match group 2 is regular playlist url // See https://tools.ietf.org/html/rfc8216 for HLS spec details const playlistRegexp = diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index b189d39b60..2468644605 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -211,6 +211,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { if (!this.hass!.connection.connected) { return; } + window.stop(); this.hass!.connection.suspend(); }