Fixes for when player is left in the background.

This commit is contained in:
Dermot Duffy
2021-10-23 10:05:27 -07:00
parent 9e543dbb5a
commit 2ed6b98278
+5
View File
@@ -219,6 +219,7 @@ export class FrigateCardLiveJSMPEG extends LitElement {
}, },
}, },
{ {
pauseWhenHidden: false,
protocols: [], protocols: [],
audio: false, audio: false,
videoBufferSize: 1024 * 1024 * 4, videoBufferSize: 1024 * 1024 * 4,
@@ -253,11 +254,15 @@ export class FrigateCardLiveJSMPEG extends LitElement {
connectedCallback(): void { connectedCallback(): void {
super.connectedCallback(); super.connectedCallback();
if (this.isConnected) {
this.requestUpdate(); this.requestUpdate();
} }
}
disconnectedCallback(): void { disconnectedCallback(): void {
if (!this.isConnected) {
this._resetPlayer(); this._resetPlayer();
}
super.disconnectedCallback(); super.disconnectedCallback();
} }