Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roku Progress Bar #107702

Closed
jhemak opened this issue Jan 10, 2024 · 8 comments · Fixed by #117059
Closed

Roku Progress Bar #107702

jhemak opened this issue Jan 10, 2024 · 8 comments · Fixed by #117059
Assignees

Comments

@jhemak
Copy link

jhemak commented Jan 10, 2024

The problem

When playing content from Roku, the progress bar shown in both the built-in media player card as well as the mini media player do not seem to reflect actual progress while content is playing, however when content is paused the bar jumps to the correct position. Upon resuming play, the bar jumps back to the original (incorrect) position. In one instance, I saw the bar at 100% when just starting content. In other cases, it wasn't quite 100% but still much further ahead than the content actually was. In both cases, pausing the content caused the progress bar to temporarily jump to the correct position. The behavior is identical with both media player cards.

While Playing:
image

While Paused:
image

What version of Home Assistant Core has the issue?

core-2024.1.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Roku

Link to integration documentation on our website

https://www.home-assistant.io/integrations/roku/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

These fields are populated on the Roku media player both while the content is being played and while it's being paused:

media_duration: 9678
media_position: 2353
media_position_updated_at: "2024-01-10T03:47:46.195789+00:00"

Additional information

No response

@home-assistant
Copy link

Hey there @ctalkington, mind taking a look at this issue as it has been labeled with an integration (roku) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roku can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign roku Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


roku documentation
roku source
(message by IssueLinks)

@ctalkington
Copy link
Contributor

ctalkington commented Mar 20, 2024

pause triggers an update of polled data. that would explain the update of progress on pause.

Since we poll, we track the duration, position, and time at which that position was updated. This should be enough to simulate an accurate playback progress. unless something has changed in the front-end cards or widgets.

Has this happened in older versions of HomeAssistant? or something new in 2024? Are you doing anything to customize the Polling intervals (10s default)?

@ctalkington
Copy link
Contributor

also did this content have ads? I wonder if that could be making progress appear further since we assume constant playback for progress purposes

@jhemak
Copy link
Author

jhemak commented Mar 21, 2024

Hello, thanks for the follow up on this. No ads in the content, no custom polling, and I can't say that it ever worked for me as I've only been using HA for a few months. I just tried another test today and confirmed a couple things. My test used both the native Media Control card as well as the Mini Media Player custom card.

(1) When I played the content, the progress bar on both cards was at 100%. Here are three attributes from the Roku media player at that time:

media_duration: 658
media_position: 81
media_position_updated_at: "2024-03-19T22:18:13.650708+00:00"

(2) When I pressed pause, the progress bar on both cards immediately dropped to something like 10% ... much closer to the actual progress of the content that had been playing. Here are the attributes at that point:

media_duration: 658
media_position: 99
media_position_updated_at: "2024-03-19T22:18:13.650708+00:00"

(3) And then I play again. Right back to 100% on the progress bar, with these attributes:

media_duration: 658
media_position: 109
media_position_updated_at: "2024-03-19T22:18:13.650708+00:00"

Is it strange and/or relevant that media_position_updated_at is the same all three times?

@jhemak
Copy link
Author

jhemak commented Mar 30, 2024

@ctalkington - any thoughts based on the above?

@ctalkington
Copy link
Contributor

the media_position_updated_at could be the culprit. as it would cause the whole progress equation to be wrong. I don't know what the actual time was but what's suppose to happen is time between updated_at and now is suppose to be added to the position so if the position changes but the timestamp doesn't you are definitely out of sync.

@jhemak
Copy link
Author

jhemak commented Mar 30, 2024

That makes sense. If this is something you are able to fix I would be happy to help test. Thank you!

@jhemak
Copy link
Author

jhemak commented May 11, 2024

Thank you for fixing this @ctalkington! It’s working perfectly now.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants