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

[Feature Request] Better updates to media session position #178

Open
za722-ic opened this issue Dec 8, 2024 · 1 comment
Open

[Feature Request] Better updates to media session position #178

za722-ic opened this issue Dec 8, 2024 · 1 comment
Labels
type: feature New feature or request

Comments

@za722-ic
Copy link

za722-ic commented Dec 8, 2024

Describe the problem/motivation

Currently, the position timestamp in a media session does not remain synchronised with the actual media being played. For instance, if I play a YouTube video in Firefox, I can only make the position value update to the correct value when I:

  1. Unpause the video
  2. Scrub through the video

But letting the video play does not update the position value.

Describe the solution you'd like

Have a way to ensure the position remains synchronised with the actual media position. Perhaps this could mean the media provider gets a refreshInterval configuration option like other providers, if possible.

Alternatives considered

One option might be to manually increment the position value by 1 each second of whilst isPlaying is true. However, I don't think this option would work if the video is playing at a different speed than 1 second per second, or if internet connection is lost during online media playback.

Perhaps #75 could be used to manually synchronise position?

PS Apologies if this is an issue to do with #175. However, I am able to see title just fine on 2.6.1, unlike in #175. Also, even if the current behaviour is deliberate, I'd still like more control over information updates within the media widget.

PPS Thank you for all your work on this wonderful application!

@za722-ic za722-ic added the type: feature New feature or request label Dec 8, 2024
@github-project-automation github-project-automation bot moved this to 📬 Needs triage in zebar Dec 8, 2024
@za722-ic
Copy link
Author

So, from what I understand, this is applicable. TL;DR Media position updates are done via GSMTC (on Windows), and it's up to individual applications to issue those updates. Zebar can only read the result from these updates. Hence, there isn't anything that can be done from Zebar's end.

However, I have found a workaround that works 90% of the time for me:

  • For local media, Screenbox updates the media position every 5 seconds. Just installing it worked with no need for further configuration.
  • For most online media, WebNowPlaying works well. The way I integrated this with Zebar was to use a powershell script to poll wnpcli for the latest timestamp, write this timestamp to a text file, and then use robertmoelker's suggestion on [Feature Request] Shell / text provider #75 to repeatedly read the text file and update Zebar. I'd be happy to know of better solutions.

This issue is solved for me, so I'm happy if the devs want to close it. I'm not sure on the etiquette in that regard (I'm new to this!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
Status: 📬 Needs triage
Development

No branches or pull requests

1 participant