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

Media buttons not working when mpv isn't focused #9336

Closed
BeauTaapken opened this issue Oct 21, 2021 · 24 comments · Fixed by #14338
Closed

Media buttons not working when mpv isn't focused #9336

BeauTaapken opened this issue Oct 21, 2021 · 24 comments · Fixed by #14338
Labels

Comments

@BeauTaapken
Copy link

Important Information

Provide following Information:

Reproduction steps

1: Start mpv in any way you want(exe or terminal).
2: Focus on another window like a browser or game.
3: try to use media buttons.

Expected behavior

The player receives the media button input

Actual behavior

The player doesn't receive the media button input

Log file

output.txt.

@stax76
Copy link
Contributor

stax76 commented Oct 24, 2021

Global hotkeys are generally not supported in mpv I think. They are supported in mpv.net via global-input.conf file.

There might be a way using AutoHotkey, if you can find out how to send commands to mpv with JSON IPC, in mpv.net it's possible to send input commands via CLI without JSON IPC:

https://github.com/stax76/mpv.net/blob/master/docs/Manual.md#--commandinput-command

@avih
Copy link
Member

avih commented Oct 24, 2021

Global hotkeys are generally not supported in mpv I think

Global hotkeys in general are not supported, but global media keys should work on windows and osx, and are supposedly enabled by default. See https://mpv.io/manual/master/#options-input-media-keys

I tested it on osx and it works. On windows it should work but I don't have a KB with media keys to test.

@WhoMI7
Copy link

WhoMI7 commented Nov 25, 2021

Global hotkeys are generally not supported in mpv I think

Global hotkeys in general are not supported, but global media keys should work on windows and osx, and are supposedly enabled by default. See https://mpv.io/manual/master/#options-input-media-keys

I tested it on osx and it works. On windows it should work but I don't have a KB with media keys to test.

Yes they do work but if and only if mpv is focused or on top, if it's in background(not on top) or minimized it won't work.

@stax76
Copy link
Contributor

stax76 commented Nov 25, 2021

AutoHotkey is an essential tool on Windows, for global mpv media keys the following works:

Media_Play_Pause::ControlSend, ahk_parent, {Space}, ahk_exe mpv.exe

@WhoMI7
Copy link

WhoMI7 commented Nov 25, 2021

AutoHotkey is an essential tool on Windows, for global mpv media keys the following works:

Media_Play_Pause::ControlSend, ahk_parent, {Space}, ahk_exe mpv.exe

Sure works for play/pause. Forward/Backward, stop media keys won't work.

@escapezn
Copy link

escapezn commented Jan 1, 2022

mpv 0.34 has the same issue.

@escapezn
Copy link

escapezn commented Jul 30, 2024

I tried the latest build here, but it doesn't seem to work.

@kasper93
Copy link
Contributor

It works, but if you have multiple media players open, you have to select the one you want to control in media controls window.

@escapezn
Copy link

escapezn commented Jul 30, 2024

I'm not sure what I missed but the media controls don't show the tracks when mpv is playing. I only run a single media player.
屏幕截图 2024-07-30 221340
屏幕截图 2024-07-30 221420

@kasper93
Copy link
Contributor

post logs

@escapezn
Copy link

mpv.log

@zhongfly
Copy link

zhongfly commented Jul 31, 2024

I tried the latest build here, but it doesn't seem to work.

If you are talking about Media Control or System Media Transport Controls (#14338), I should tell you that shinchiro's build didn't support it yet.

@escapezn
Copy link

I tried the latest build here, but it doesn't seem to work.

If you are talking about Media Control or System Media Transport Controls (#14338), I should tell you that shinchiro's build didn't support it yet.

Oh it's pity

@zhongfly
Copy link

zhongfly commented Jul 31, 2024

If you are talking about Media Control or System Media Transport Controls (#14338), I should tell you that shinchiro's build didn't support it yet.

Oh it's pity

If you want to try Media Control, you can use my builds: https://github.com/zhongfly/mpv-winbuild/releases/latest
And shinchiro's builds will support it after shinchiro/mpv-winbuild-cmake#670 merged (my builds have merged it)

@escapezn
Copy link

escapezn commented Jul 31, 2024

If you are talking about Media Control or System Media Transport Controls (#14338), I should tell you that shinchiro's build didn't support it yet.

Oh it's pity

If you want to try Media Control, you can use my builds: https://github.com/zhongfly/mpv-winbuild/releases/latest And shinchiro's builds will support it after shinchiro/mpv-winbuild-cmake#670 merged (my builds have merged it)

I noticed that there are no thumbnails (album art) on the media controls when playing music, is that expected? What about 6a43514 ?

@kasper93
Copy link
Contributor

I noticed that there are no thumbnails (album art) on the media controls when playing music, is that expected? What about 6a43514 ?

There are multiple factors that may affect if thumbnail is shown or not. Do you have exact example when it fails and should work? I can look, but need steps to reproduce.

@escapezn
Copy link

escapezn commented Aug 1, 2024

I noticed that there are no thumbnails (album art) on the media controls when playing music, is that expected? What about 6a43514 ?

There are multiple factors that may affect if thumbnail is shown or not. Do you have exact example when it fails and should work? I can look, but need steps to reproduce.

No matter the albumart is internal or external, there are no thumbnails in media control. This is a sample file.

I am using @zhongfly's build with no config file for test.
屏幕截图 2024-08-01 203340
mp3.zip

@zhongfly
Copy link

zhongfly commented Aug 1, 2024

No matter the albumart is internal or external, there are no thumbnails in media control. This is a sample file.

I am using @zhongfly's build with no config file for test. 屏幕截图 2024-08-01 203340 mp3.zip

work for me,I'm using Windows 11 23H2
image

@escapezn
Copy link

escapezn commented Aug 1, 2024

Interestingly video files are ok, as long as windows explorer can show thumbnails, media controls can. Otherwise it will show the mpv icon. I'm running windows 10 22h2.

@zhongfly
Copy link

zhongfly commented Aug 1, 2024

Interestingly video files are ok, as long as windows explorer can show thumbnails, media controls can. Otherwise it will show the mpv icon. I'm running windows 10 22h2.

work for my windows 10 22h2 19045.4651 (Windows Feature Experience Pack 1000.19060.1000.0)
image

@kasper93
Copy link
Contributor

kasper93 commented Aug 1, 2024

No matter the albumart is internal or external, there are no thumbnails in media control. This is a sample file.

I am using @zhongfly's build with no config file for test. 屏幕截图 2024-08-01 203340 mp3.zip

work for me,I'm using Windows 11 23H2
image

How do you manage to make it show the mpv logo and name it the top left corner? It doesn't work for me. I'm curious what it is based on.

@zhongfly
Copy link

zhongfly commented Aug 1, 2024

How do you manage to make it show the mpv logo and name it the top left corner? It doesn't work for me. I'm curious what it is based on.

It should be one of those commands: https://github.com/shinchiro/mpv-packaging/blob/master/mpv-root/installer/mpv-install.bat
I found that I was able to show the mpv logo and name after using this script to install mpv

@kasper93
Copy link
Contributor

kasper93 commented Aug 1, 2024

someone™ should port it to mpv. Not by default, but --install or --register command should be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants