Skip to content

Conversation

@Der-Penz
Copy link
Contributor

@Der-Penz Der-Penz commented Aug 2, 2025

This PR enables the navigator.mediaSession api so windows will display information about the current song next to the volume bar.

What changed:
HardwareMediaKeyHandling, MediaSessionService features are not disabled anymore to make the mediaSession api work.

I plan to implement more events for the mediaSession api like next previous.
But I am not sure what the reason was to disable those 2 features. Maybe there is a good reason for it and enabling it would break stuff. In that case I would look into it, on how it could be resolved since the mediaSession is a nice to have Feature.

@vercel
Copy link

vercel bot commented Aug 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
feishin Ready Ready Preview Comment Oct 12, 2025 5:21pm

@Der-Penz
Copy link
Contributor Author

Der-Penz commented Aug 2, 2025

This should also close #649 when implemented

@mihawk90
Copy link
Contributor

mihawk90 commented Aug 2, 2025

This will have to be handled platform specific as enabling this outright will conflict with MPRIS on Linux at least. Don't know about Mac.

That aside there is probably a reason why HardwareMediaKeyHandling is on the disabled list as well, and this PR also removes that without explanation.

Leaving the line in the file as a comment also serves no purpose. If you just want to keep it for reference as how it used to be, that is what Git is for. If you're going to remove a line, remove it completely.

@kgarner7
Copy link
Collaborator

kgarner7 commented Aug 3, 2025

This was discussed in the Discord (/matrix bridge).
The correct mechanism would be to just use MediaSession API for Electron (when not using MPV player).

@Der-Penz
Copy link
Contributor Author

Der-Penz commented Aug 3, 2025

This will have to be handled platform specific as enabling this outright will conflict with MPRIS on Linux at least. Don't know about Mac.

One simple approach would be to enable it only on Windows via a process.platform check.
This would at least make the feature work on Windows without touching the Linux/Mac flows.

Alternatively, we could make this configurable for users who want navigator.mediaSession integration, while keeping it off by default on platforms where conflicts are known or unverified.

@Der-Penz Der-Penz marked this pull request as ready for review August 19, 2025 14:28
@jeffvli
Copy link
Owner

jeffvli commented Aug 28, 2025

I would prefer you add a toggle in the settings to Enable/Disable this feature, as there are some (including myself) that wouldn't want this enabled.

Toggling the setting should prompt the user to restart the app (similar to some other settings) since it's configured within the electron main process.

@jeffvli jeffvli merged commit f07393c into jeffvli:development Oct 12, 2025
8 checks passed
@Der-Penz Der-Penz deleted the media-control branch October 14, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants