Allow the user to specify image URL for image live provider.
This commit is contained in:
@@ -51,8 +51,9 @@ export class FrigateCardLiveImage extends LitElement implements FrigateCardMedia
|
||||
|
||||
return html` <frigate-card-image
|
||||
.imageConfig=${{
|
||||
mode: 'camera' as const,
|
||||
mode: this.cameraConfig.image.url ? 'url' as const : 'camera' as const,
|
||||
refresh_seconds: this._playing ? this.cameraConfig.image.refresh_seconds : 0,
|
||||
url: this.cameraConfig.image.url,
|
||||
// Don't need to pass layout options as FrigateCardLiveProvider has
|
||||
// already taken care of this for us.
|
||||
}}
|
||||
|
||||
@@ -723,12 +723,14 @@ export class FrigateCardLiveProvider
|
||||
// If the play call fails, and the media is not already muted, mute it first
|
||||
// and then try again. This works around some browsers that prevent
|
||||
// auto-play unless the video is muted.
|
||||
this._providerRef.value?.play().catch((ev) => {
|
||||
if (ev.name === 'NotAllowedError' && !this.isMuted()) {
|
||||
this.mute();
|
||||
this._providerRef.value?.play().catch();
|
||||
}
|
||||
});
|
||||
if (this._providerRef.value?.play) {
|
||||
this._providerRef.value?.play().catch((ev) => {
|
||||
if (ev.name === 'NotAllowedError' && !this.isMuted()) {
|
||||
this.mute();
|
||||
this._providerRef.value?.play().catch();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public pause(): void {
|
||||
|
||||
Reference in New Issue
Block a user