mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Media Card: Fix Progress update (#5096)
This commit is contained in:
parent
8e7ef58715
commit
b72d8cf7d7
@ -24,6 +24,10 @@ export interface MediaPlayerThumbnail {
|
|||||||
|
|
||||||
export const getCurrentProgress = (stateObj: HassEntity): number => {
|
export const getCurrentProgress = (stateObj: HassEntity): number => {
|
||||||
let progress = stateObj.attributes.media_position;
|
let progress = stateObj.attributes.media_position;
|
||||||
|
|
||||||
|
if (stateObj.state !== "playing") {
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
progress +=
|
progress +=
|
||||||
(Date.now() -
|
(Date.now() -
|
||||||
new Date(stateObj.attributes.media_position_updated_at).getTime()) /
|
new Date(stateObj.attributes.media_position_updated_at).getTime()) /
|
||||||
|
Loading…
x
Reference in New Issue
Block a user