mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +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 => {
|
||||
let progress = stateObj.attributes.media_position;
|
||||
|
||||
if (stateObj.state !== "playing") {
|
||||
return progress;
|
||||
}
|
||||
progress +=
|
||||
(Date.now() -
|
||||
new Date(stateObj.attributes.media_position_updated_at).getTime()) /
|
||||
|
Loading…
x
Reference in New Issue
Block a user