mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix key type errors for media player
This commit is contained in:
parent
d23d774ec1
commit
0ebeec0db6
@ -177,7 +177,7 @@ export interface MediaPlayerItem {
|
|||||||
title: string;
|
title: string;
|
||||||
media_content_type: string;
|
media_content_type: string;
|
||||||
media_content_id: string;
|
media_content_id: string;
|
||||||
media_class: string;
|
media_class: keyof TranslationDict["ui"]["components"]["media-browser"]["class"];
|
||||||
children_media_class?: string;
|
children_media_class?: string;
|
||||||
can_play: boolean;
|
can_play: boolean;
|
||||||
can_expand: boolean;
|
can_expand: boolean;
|
||||||
|
@ -39,6 +39,7 @@ import {
|
|||||||
cleanupMediaTitle,
|
cleanupMediaTitle,
|
||||||
computeMediaControls,
|
computeMediaControls,
|
||||||
computeMediaDescription,
|
computeMediaDescription,
|
||||||
|
ControlButton,
|
||||||
formatMediaTime,
|
formatMediaTime,
|
||||||
getCurrentProgress,
|
getCurrentProgress,
|
||||||
handleMediaControlClick,
|
handleMediaControlClick,
|
||||||
@ -179,7 +180,7 @@ export class BarMediaPlayer extends SubscribeMixin(LitElement) {
|
|||||||
return this._renderChoosePlayer(stateObj);
|
return this._renderChoosePlayer(stateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
const controls = !this.narrow
|
const controls: ControlButton[] | undefined = !this.narrow
|
||||||
? computeMediaControls(stateObj, true)
|
? computeMediaControls(stateObj, true)
|
||||||
: (stateObj.state === "playing" &&
|
: (stateObj.state === "playing" &&
|
||||||
(supportsFeature(stateObj, SUPPORT_PAUSE) ||
|
(supportsFeature(stateObj, SUPPORT_PAUSE) ||
|
||||||
@ -207,7 +208,7 @@ export class BarMediaPlayer extends SubscribeMixin(LitElement) {
|
|||||||
: "media_stop",
|
: "media_stop",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: [{}];
|
: undefined;
|
||||||
const mediaDescription = computeMediaDescription(stateObj);
|
const mediaDescription = computeMediaDescription(stateObj);
|
||||||
const mediaDuration = formatMediaTime(stateObj.attributes.media_duration);
|
const mediaDuration = formatMediaTime(stateObj.attributes.media_duration);
|
||||||
const mediaTitleClean = cleanupMediaTitle(
|
const mediaTitleClean = cleanupMediaTitle(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user