-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Mac control center support (Fixes #549) #567
base: development
Are you sure you want to change the base?
Mac control center support (Fixes #549) #567
Conversation
Only working in the web version, not sure why
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, but I'm not really sure what this is trying to do:
navigator.mediaSession
already is in use, but inuse-center-controls.ts
. While there is some room for improvement there, it does at least work in web browsers on MacOS (Safari, Firefox, Chrome)- The change as proposed is also broken:
Cannot read properties of undefined (reading 'name')
when the queue is empty (most likely artist metadata)- More severely, I see
Invalid hook call. Hooks can only be called inside the body of a function component
about every second. - At least on Feishin Desktop on macOS, this doesn't seem to help either (I don't personally understand why, even with mediaSession set properly MacOS doesn't show)
- This removes the ability for mediaSession to play/pause/etc.
I appreciate the time you spent, I would also like this to be fixed on desktop (and less janky elsewhere as well) [I did try and look why mediaSession isn't updating control center, but I haven't found any good leads thus far). But I'd much rather fix the existing implementation (or find out something macOS desktop-only that we're missing in the first place)
@kgarner7 I've fixed 2.i and 2.ii just now (will push in a few), also mediaSession play pause seems to work fine for me. I'll push in just a sec |
🤦🏻 Didn't even see use-center-controls.ts lol Could it maybe not be working due to the |
The issue with electron vs web might be due to BrowserWindow instead of BrowserView: |
Using use-center-controls isn't setting (I commented out my code when testing this) |
It does look like there is an issue where the first track doesn't get metadata, but it definitely sets it otherwise. And I having the actionHandler without |
Yeah I've been looking through it - It only seems to update when you click pause and play buttons not on skipping songs. I don't have time to work on it more right now but I can later. Some improvements I want to make though:
|
@kgarner7 I found it!! I was looking through MPV to see how they did it (take it from the pros): We probably need to use this on mac: Could use this: |
Currently only working in the web version