From 9e543dbb5ad1944fc90741be5899f4a11771ef62 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Fri, 22 Oct 2021 22:15:06 -0700 Subject: [PATCH] Don't start the timer until the last moment. --- src/components/live.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/live.ts b/src/components/live.ts index 10d710a2..908f25af 100644 --- a/src/components/live.ts +++ b/src/components/live.ts @@ -269,11 +269,11 @@ export class FrigateCardLiveJSMPEG extends LitElement { this._jsmpegURL = await this._getURL(); if (this._jsmpegURL) { + this._jsmpegVideoPlayer = this._createJSMPEGPlayer(); + this._refreshPlayerTimerID = window.setTimeout(() => { this._refreshPlayer(); }, (URL_SIGN_EXPIRY_SECONDS - URL_SIGN_REFRESH_THRESHOLD_SECONDS) * 1000); - - this._jsmpegVideoPlayer = this._createJSMPEGPlayer(); } this.requestUpdate(); }