mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +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"))
|
||||
.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 =
|
||||
|
@ -211,6 +211,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
|
||||
if (!this.hass!.connection.connected) {
|
||||
return;
|
||||
}
|
||||
window.stop();
|
||||
this.hass!.connection.suspend();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user