From 9a8d0803c89cf73a6f43dc2440dcde6f2e9d4f5f Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 12 Sep 2021 15:41:20 -0700 Subject: [PATCH] Add comment explaining odd choice of Promise usage. --- src/frigate-hass-card.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frigate-hass-card.ts b/src/frigate-hass-card.ts index ec37f360..3f93c49c 100644 --- a/src/frigate-hass-card.ts +++ b/src/frigate-hass-card.ts @@ -1001,6 +1001,10 @@ export class FrigateCard extends LitElement { return this._renderError('Could not retrieve or sign JSMPEG websocket path'); } + // Return the html canvas node only after the JSMPEG video has loaded and + // is playing, to reduce the amount of time the user is staring at a blank + // white canvas (instead they get the progress spinner until this promise + // resolves). return new Promise((resolve) => { this._jsmpegPlayer = new JSMpeg.VideoElement( this,