Fix key type errors for media player

This commit is contained in:
Steve Repsher 2022-07-15 10:21:00 -04:00
parent d23d774ec1
commit 0ebeec0db6
No known key found for this signature in database
GPG Key ID: 776C4F2DACF6131B
2 changed files with 4 additions and 3 deletions

View File

@ -177,7 +177,7 @@ export interface MediaPlayerItem {
title: string;
media_content_type: string;
media_content_id: string;
media_class: string;
media_class: keyof TranslationDict["ui"]["components"]["media-browser"]["class"];
children_media_class?: string;
can_play: boolean;
can_expand: boolean;

View File

@ -39,6 +39,7 @@ import {
cleanupMediaTitle,
computeMediaControls,
computeMediaDescription,
ControlButton,
formatMediaTime,
getCurrentProgress,
handleMediaControlClick,
@ -179,7 +180,7 @@ export class BarMediaPlayer extends SubscribeMixin(LitElement) {
return this._renderChoosePlayer(stateObj);
}
const controls = !this.narrow
const controls: ControlButton[] | undefined = !this.narrow
? computeMediaControls(stateObj, true)
: (stateObj.state === "playing" &&
(supportsFeature(stateObj, SUPPORT_PAUSE) ||
@ -207,7 +208,7 @@ export class BarMediaPlayer extends SubscribeMixin(LitElement) {
: "media_stop",
},
]
: [{}];
: undefined;
const mediaDescription = computeMediaDescription(stateObj);
const mediaDuration = formatMediaTime(stateObj.attributes.media_duration);
const mediaTitleClean = cleanupMediaTitle(