From 2ed6b98278f93e8f3b0b92c4897aafbaf1560654 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sat, 23 Oct 2021 10:05:27 -0700 Subject: [PATCH] Fixes for when player is left in the background. --- src/components/live.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/live.ts b/src/components/live.ts index 908f25af..0fc2cce1 100644 --- a/src/components/live.ts +++ b/src/components/live.ts @@ -219,6 +219,7 @@ export class FrigateCardLiveJSMPEG extends LitElement { }, }, { + pauseWhenHidden: false, protocols: [], audio: false, videoBufferSize: 1024 * 1024 * 4, @@ -253,11 +254,15 @@ export class FrigateCardLiveJSMPEG extends LitElement { connectedCallback(): void { super.connectedCallback(); - this.requestUpdate(); + if (this.isConnected) { + this.requestUpdate(); + } } disconnectedCallback(): void { - this._resetPlayer(); + if (!this.isConnected) { + this._resetPlayer(); + } super.disconnectedCallback(); }