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

shortcuts plugin blocks native MediaSession api #204

Closed
Araxeus opened this issue Mar 25, 2021 · 4 comments · Fixed by #218
Closed

shortcuts plugin blocks native MediaSession api #204

Araxeus opened this issue Mar 25, 2021 · 4 comments · Fixed by #218

Comments

@Araxeus
Copy link
Collaborator

Araxeus commented Mar 25, 2021

see #50
After spending tons of hours researching the MediaSession API and way of implementation,
I realized Electron supported it all along, it just wasnt working because of the shortcuts plugin

Youtube Music even set it up automatically for each song, no need to do anything,,
⚠️ that includes media key controls, so =>
disabling the shortcuts plugin will still let you use mediakeys control + have native MediaSession support

[This has been tested on Windows && Linux with the help of helpful guys over at Electron]

So anyway I think you probably should atleast remove shortcuts from the default plugins, at this state it only removes features. - people that want to disable that overlay could just enable the plugin

Example screenshot to show MediaSession api working with youtube-music on windows
25-03-2021 16 54 07

@Araxeus Araxeus changed the title shortcuts plugin blocks native windows api shortcuts plugin blocks native MediaSession api Mar 25, 2021
@semvis123
Copy link
Contributor

Interesting, but after disabling shortcuts the thumbnail/album art still isn't present on macOS, even Spotify has this issue, so my guess is that it is something Apple related. However, the song duration and elapsed seconds are also not present on macOS (the now playing menu), this issue is not present on Spotify and should thus be fixable.

@Araxeus
Copy link
Collaborator Author

Araxeus commented Mar 25, 2021

The duration and elapsed seconds don't show on my pc [Windows 10] with any app, so I can't really try to fix that
maybe you should try :)
Google example
W3 Docs
Mozilla Docs

@semvis123
Copy link
Contributor

The duration and elapsed seconds do show on those examples 🤔
So we could try and add those values to the media session, but I don't know if that is going to be easy, I will look into this.

@semvis123
Copy link
Contributor

looks like chromium doesn't have the song position implemented, because when I test the example site on Chrome the duration and elapsed seconds are not present, Safari works fine though.
I did however find a npm package that can set the correct song information for macOS (claims that other platforms are supported but it doesn't look like it). Here's a fork of it that also includes the album art.
https://github.com/dimitarnestorov/electron-media-service
That npm package doesn't look like it is being maintained anymore, so I don't know if that is a perfect option.
But maybe this would be a great plugin for macOS only.

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 a pull request may close this issue.

2 participants