spmp icon indicating copy to clipboard operation
spmp copied to clipboard

Feature Request: Add support for media control

Open PopCat19 opened this issue 1 year ago • 7 comments

This feature should allow spmp playback to be controlled by any hardware that uses the system media control. (e.g keyboard) image

PopCat19 avatar Mar 23 '24 22:03 PopCat19

Do you know any open-source Java applications that have this feature? I'm not entirely sure where to start, especially for Windows.

toasterofbread avatar Mar 24 '24 17:03 toasterofbread

Here's what I searched so far:

  • Stack Overflow about media keys: https://stackoverflow.com/questions/30221022/how-to-emulate-pressing-media-keys-in-java

  • The repo mentioned in that overflow: https://github.com/nsnave/java-media-keys

PopCat19 avatar Mar 24 '24 18:03 PopCat19

That seems to be for simulating media key presses, not for detecting them.

toasterofbread avatar Mar 24 '24 18:03 toasterofbread

How about this library? It's windows specific though. https://github.com/melloware/jintellitype

PopCat19 avatar Mar 24 '24 18:03 PopCat19

That seems like it'd work for media keys, but media session won't be shared with the system like in your screenshot.

toasterofbread avatar Mar 26 '24 12:03 toasterofbread

For my own later reference, this library seems like it would work: https://github.com/Selemba1000/JavaMediaTransportControls

toasterofbread avatar Apr 07 '24 15:04 toasterofbread

The library I mentioned seems to work on Linux, but on Windows it depends on DLL blobs with no source code so I won't be able to use it until https://github.com/Selemba1000/JavaMediaTransportControls/issues/1 is resolved.

toasterofbread avatar Apr 07 '24 22:04 toasterofbread

I've implemented media controls for the native Windows target of mediasessionkt. Support for the JVM target (and by extension SpMp) should follow soon.

toasterofbread avatar May 06 '24 23:05 toasterofbread

Added by dd8ac3d

toasterofbread avatar May 11 '24 23:05 toasterofbread