You are not logged in.

#1 2024-10-16 02:59:43

FishBoneEK
Member
Registered: 2023-09-26
Posts: 57

Cannot control VLC and mpv properly with Media Play key

There's some media keys on my keyboard, and I can let Firefox play or pause by pressing the play/pause key.
But for mpv it doesn't work at all, mpv doesn't respond to that.
I can pause VLC with my play/pause key, but cannot resume after that.

And...I can't assign my media keys in VLC because VLC cannot detect my media key press. BUT, there's some Media Controller shortcuts in my KDE setting and I can assign media keys to them, they are already assigned by default. So I think right now KDE is monitoring media keys, and relays media controlling events to applications.

So I kind of don't get what's going on? Perhaps there's an option somewhere to enable controlling mpv with media keys. As for VLC, probably either KDE or VLC went a bit wrong.

Offline

#2 2024-10-16 06:01:32

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: Cannot control VLC and mpv properly with Media Play key

They're likely assigned to a global daemon (kglobalaccel) that forwards them via https://wiki.archlinux.org/title/MPRIS
https://wiki.archlinux.org/title/Mpv#mpv-mpris needs a plugin, no idea why vlc doesn't resume but I assume the key is bound to pause, not playpause?

Offline

#3 2024-10-17 12:16:13

FishBoneEK
Member
Registered: 2023-09-26
Posts: 57

Re: Cannot control VLC and mpv properly with Media Play key

seth wrote:

no idea why vlc doesn't resume but I assume the key is bound to pause, not playpause?

I checked, it's bound to play/pause.
Btw I installed playerctl, and I can control VLC with it: `playerctl play-pause` works fine. But my play/pause key just wouldn't work with VLC.

Offline

#4 2024-10-17 14:10:26

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: Cannot control VLC and mpv properly with Media Play key

I checked, it's bound to play/pause.

Where exactly? In vlc or in KDE?
More success w/ the mpv plugin?

Offline

#5 2024-10-18 04:03:34

FishBoneEK
Member
Registered: 2023-09-26
Posts: 57

Re: Cannot control VLC and mpv properly with Media Play key

seth wrote:

Where exactly? In vlc or in KDE?

In KDE my Media Play key is assigned to "Play/Pause media playback".
In VLC, "play/pause" is assigned to "Space" and "Media Play/Pause".
Both shortcuts in KDE and VLC are default settings.
Though in KDE it's "Media Play" and in VLC it's "Media Play/Pause", I believe they correspond to the same key, because if I delete the shortcuts and then add them back again seperately by pressing my Media Play/Pause key, KDE shows "Media Play" and VLC shows "Media Play/Pause".
Btw, if I have my "Media Play" assigned in KDE, I can't change the shortcut in VLC because VLC doesn't respond to my keystroke. I think it's because KDE intercepted the keystroke.

seth wrote:

More success w/ the mpv plugin?

Installed mpv-mpris, works perfectly.

Last edited by FishBoneEK (2024-10-18 04:08:29)

Offline

#6 2024-10-18 06:02:20

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: Cannot control VLC and mpv properly with Media Play key

KDE grabs a global shortcut that will hide the key from clients, that's normal.
If you disable that and assign the internal VLC shortcut and that can also no toggle play/pause, that would rather point at a VLC issue (how does the space key behave?)

To see what gets send to VLC, run

dbus-monitor --session &| tee /tmp/dbm.log

and press the key (the dbus traffic should also be logged to /tmp/dbm.log)

Offline

Board footer

Powered by FluxBB