mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 14:27:20 +00:00
Don't start video after the element was removed from DOM (#9813)
This commit is contained in:
parent
2556b0d157
commit
456209dded
@ -98,6 +98,11 @@ class HaHLSPlayer extends LitElement {
|
|||||||
|
|
||||||
const Hls: typeof HlsType = (await import("hls.js/dist/hls.light.min"))
|
const Hls: typeof HlsType = (await import("hls.js/dist/hls.light.min"))
|
||||||
.default;
|
.default;
|
||||||
|
|
||||||
|
if (!this.isConnected) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let hlsSupported = Hls.isSupported();
|
let hlsSupported = Hls.isSupported();
|
||||||
|
|
||||||
if (!hlsSupported) {
|
if (!hlsSupported) {
|
||||||
@ -115,6 +120,10 @@ class HaHLSPlayer extends LitElement {
|
|||||||
const useExoPlayer = await useExoPlayerPromise;
|
const useExoPlayer = await useExoPlayerPromise;
|
||||||
const masterPlaylist = await (await masterPlaylistPromise).text();
|
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
|
// 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
|
// See https://tools.ietf.org/html/rfc8216 for HLS spec details
|
||||||
const playlistRegexp =
|
const playlistRegexp =
|
||||||
|
@ -211,6 +211,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
|
|||||||
if (!this.hass!.connection.connected) {
|
if (!this.hass!.connection.connected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
window.stop();
|
||||||
this.hass!.connection.suspend();
|
this.hass!.connection.suspend();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user