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

[Feature Request] Add support for MPV #1

Open
ykhurshid opened this issue Feb 17, 2022 · 10 comments
Open

[Feature Request] Add support for MPV #1

ykhurshid opened this issue Feb 17, 2022 · 10 comments

Comments

@ykhurshid
Copy link

ykhurshid commented Feb 17, 2022

Yes, I'm one of those MPV stands. Would love a way for it to stay on top in Gnome Wayland

@Rafostar
Copy link
Owner

Rafostar commented Feb 19, 2022

This is gonna get hacky with other applications that do not have any sort of special PiP mode (in case of mpv, --ontop option is a noop on Wayland - does nothing) unlike Firefox and Clapper.

Since there are no windowing hints set, one way with MPV is to detect it through window title:

mpv --title="Picture-in-Picture" "video.mp4"

Something like above should work with the extension, but it seems very inconvenient to me. Consider switching to Clapper media player 😉

@ykhurshid
Copy link
Author

I'll see how Clapper evolves. It would have to be exceptional to top MPV in my eyes - especially with the mountain of plugins it has accrued such as integration with sponserblock when viewing Youtube videos.

As for your solution, it wouldn't be too inconvenient at all since I can simply add a line in the mpv config line to have this be the default title for all new MPV instances.
Unfortunately, it doesn't seem to actually do anything. I guess I'll see how Clapper is till the MPV devs sort out their wayland integration.

@Rafostar
Copy link
Owner

Make sure you have this extension installed and enabled (and also did logout/login or reboot after enabling). I have tried on both GNOME Shell 41 and older 3.36 and something like:

mpv --title="Picture-in-Picture" --geometry=720 "video.mp4"

works for me without any problems (using geometry option to make initial window size smaller).

@yavko
Copy link

yavko commented Apr 5, 2022

I would like to try clapper it just doesn't support some of the web services mpv does, also is there a way to switch from and back pip with a keybind in mpv with this? Like to switch the title with a keybind?

@Rafostar
Copy link
Owner

Rafostar commented Apr 5, 2022

I would like to try clapper it just doesn't support some of the web services mpv does

That might be simply because nobody ever requested support for them to be added.

also is there a way to switch from and back pip with a keybind in mpv with this

Someone would probably need to write some additional script for MPV to do that. MPV was not designed to support PiP. This extensions simply aims to workaround the lack of PiP Wayland protocol, but app should have some sort of PiP support first (like Firefox or Clapper), otherwise its gonna be even more hacky to get this working, not to mention inconvenient to use.

@yavko

This comment was marked as off-topic.

@Rafostar
Copy link
Owner

Rafostar commented Apr 5, 2022

@yavko

does clapper support hardware encoding / decoding idk much about gstreamer.

This is not the right place to talk about Clapper. If you have any questions for it, please use Clapper matrix channel. You can find link on its github page. Let's keep conversation here limited and related to original request about MPV support for this extension.

@mgedmin
Copy link

mgedmin commented Jun 12, 2022

MPV has a keybinding (Alt-0) to set the window size to 50%. You can create custom keybindings to e.g. set the window size to 25%.

Personally I'd love to have a shell extension that would make non-fullscreened MPV windows always on top. Then switching between PiP and regular playback would be a single keystroke (f).

@emansom
Copy link
Contributor

emansom commented Jul 12, 2022

mpv doesn't really support GNOME, see docs here. Mostly a boycot of all things GNOME by the maintainer; as a consequence its window has some quirks on the Wayland session. I'd recommend using Celluloid instead and opening a issue for PiP support on their bug tracker here.

@Rafostar
Copy link
Owner

Rafostar commented Jul 12, 2022

mpv doesn't really support GNOME, see docs here. Mostly a boycot of all things GNOME by the maintainer; (...) I'd recommend using Celluloid instead

This issue is starting to turn into support this or that player suddenly. The only player where I have control over how things work and was designed to work with PiP mode (and this extension) is Clapper. I personally cannot guarantee support for any other player.

I gave example how mpv can be started to make it work, but even that worked for some and for others did not. Same may work or not will most likely apply to any other player than Clapper.

mgedmin added a commit to mgedmin/gnome-shell-extension-pip-on-top that referenced this issue May 27, 2024
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

No branches or pull requests

5 participants