Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

RFC: there should be an official GUI #5500

Closed
ghost opened this issue Feb 7, 2018 · 192 comments
Closed

RFC: there should be an official GUI #5500

ghost opened this issue Feb 7, 2018 · 192 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 7, 2018

While most mpv developers (including myself) have no interest in developing a GUI, it could be a good idea to make one of the existing GUIs "official". It would be part of the mpv-player github organization. It would receive special attention both by users and mpv core developers. The core would not need to pretend being a GUI as much as it needs now. Users prefer something more GUI-like could be redirected to it. If the core changes, the GUI could get some sort of preferential treatment to make sure it works well with it.

I don't know which existing project would be suited for that, or if anyone wants to try starting one. To make sense as an official GUI, I'd say there are the following conditions on the GUI project:

  • portable (Linux/Windows/OSX)
  • uses libmpv
  • acknowledged by all mpv developers to be good enough (otherwise we don't need to do this)
  • developers of that project must be willing to be named as official GUI
  • moving to mpv-player github organization

A list of currently known GUI frontends is here: https://github.com/mpv-player/mpv/wiki/Applications-using-mpv#gui-frontends

Any comments on whether this is a good or bad idea, any project nominations, any comments by the GUI developers?

@paulguy
Copy link

paulguy commented Feb 7, 2018

I don't have much use for a GUI since I like how mpv is just its own self-contained window with no frills around it but it probably would allow more people to be able to use mpv and create more interest for it. Would this kill off the OSC/OSD? I could live without the OSC but I do like mpv being primarily command-line/keyboard driven and just giving status changes on the OSD.

@Akemi
Copy link
Member

Akemi commented Feb 7, 2018

  • portable (Linux/Windows/OSX)

i am probably a bit alone with my opinion, but i think this is a requirement that will restrict potential GUI devs too much. imo just from a usability standpoint it isn't the best idea, since GUI and interface requirements can vastly diverge. i would rather see one GUI per platform or multi-platform projects with one leading/target platform.

i myself had planned to start developing my own GUI, though i never really came around to do it. maybe this could be a good start.

@mc4man
Copy link

mc4man commented Feb 8, 2018

I've tried at one point or another most of the linux frontends.
bomi was the best, inc. libmpv in it's source, but dead for 3 years with little chance of coming back or being forked.
baka-mplayer is ok but it's dead for a year now
gnome-mpv works ok but is too restrictive being gnome only and keeps requiring newer gnome libs
kawaii-player is unfathomable to start, may get useable with use. I'll never know..
mpc-qt could be good but seems sensitive to qt5 library versions, currently on one older install it now ftbfs, on another with newer libs builds fine, segfaults on start up.
smplayer work fine, actively developed, acts like a gui but uses the binary
xt7 requires gambas3 so users would have to acquire that if not provide in distro, iirc it also uses the binary

@mia-0
Copy link
Member

mia-0 commented Feb 8, 2018

The real problem with mpv GUIs is that mpv by itself is so good most developers lose interest in maintaining them. I originally wanted to do this after letting SMPlayer2 die, but then mpv got almost all the features I wanted so there was no point in all that effort.

@kevmitch
Copy link
Member

kevmitch commented Feb 8, 2018

I think the idea of having a one true app is diminished if there is one for each platform. It also makes the tight coupling that @wm4 is talking about harder.

@Tsubajashi
Copy link

Bomi was very nice back in the day, would it be a very hard time to fork and "fix" it? If not so much I would just try to fork it since I actually wanted to have a nice project to work on in my free time.

@pigoz
Copy link
Member

pigoz commented Feb 8, 2018

portable (Linux/Windows/OSX)

Main problem with this, is it forces it to be basically made in Qt (or Electron rofl). I don't think a single developer has the resources to make a cross-platform application that feels native on windows, linux and macosx.

For example IINA is really high quality from a user perspective, it would be quite criminal to recommend a cross-platform GUI that is worse.

@ghost
Copy link
Author

ghost commented Feb 8, 2018

Fine, I guess we can't have something portable.

@Flat
Copy link

Flat commented Feb 8, 2018

I'm in agreement with mc4man. Bomi was great while it lasted. In my opinion no other GUI on Linux has the UX to even compete with stock mpv. Iina looks nice, but I'll never use it considering it's macos only. The rest of the GUI frontends for mpv are either lacking any new features over mpv, look like something from the early 90s, or both.

That being said a new GUI that is well designed for UX and includes heavy customization would be welcome.

@ghost
Copy link
Author

ghost commented Feb 8, 2018

Regarding Bomi, it used mpv internals, which changed so much in the last years that updating it will be hard. If it had strictly used libmpv, maintaining it would have been much easier. I don't know how much work it'd be to port it to libmpv. You can try.

@orbea
Copy link
Contributor

orbea commented Feb 8, 2018

My suggestion is to make the libretro-mpv project official and use RetroArch (Or any other libretro frontend really) as the gui. This would reduce a lot of the maintenance effort on maintaining the GUI once the initial roadblocks are fixed. @deltabeard would be better familiar with what is left to do.

https://github.com/libretro/RetroArch
https://github.com/libretro/libretro-mpv

@orbea
Copy link
Contributor

orbea commented Feb 8, 2018

Just to make it clear, this would cover the portability requirements (And then some) as well as the libmpv requirement.

@deltabeard
Copy link

@orbea Eventually, I would like to see libretro-mpv to be a great contender as an official mpv GUI. There's still some work to do with libretro-mpv before I would personally consider it as a good enough media player, which I've listed here.

There may be some limitations with Retroarch too, such as playlist support, which would need to be addressed. There was some discussion here with regards to that.

@SilverEzhik
Copy link

The core would not need to pretend being a GUI as much as it needs now

I fear that dropping the OSC, if that's what this suggestion implies, would turn away the users that specifically use mpv because of how simple the interface is.

@Dudemanguy
Copy link
Member

Personally I don't care if there is an official GUI or not, but I very much like OSC and would be sad to see it go if that's what this issue implies. The OSC is my favorite mpv GUI.

@elitepleb
Copy link

A right click menu could make for a great compromise between usability and minimalism, although that might cause issues to those who prefer right click to pause.

@ghost
Copy link

ghost commented Feb 9, 2018

Has anyone thought of splitting cplayer from libmpv? If enough people want that to be an official gui, development on it could happen in independently without polluting the libmpv commit history.

@rien333
Copy link

rien333 commented Feb 9, 2018

There is barely any advanced multi-platform app that I know with a good, native feeling, nice looking GUI across all supported platforms. The work required together with the resources hit (more disk space, dependencies, GPU complications) would probably not be worth it for many. I think the community should rather step in and provide wrapper apps like IINA that take advantage of really specific OS frameworks and functionality to provide native GUI apps, while maintaining powerful mpv features of course. Most current mpv users are probably satisfied with the current setup anyway (why would they be using mpv otherwise?), and newer, less technically inclined (?) users would probably not really feel at home with a half working, semi-intergrated GUI app and would prefer more catered solutions.

It would maybe a good idea to point people to apps like IINA on the homepage for one click GUI solutions for the people that prefer that.

@ghost
Copy link
Author

ghost commented Feb 9, 2018

A right click menu would make a simple GUI, but still requires a GUI framework on Linux. Unless we do it ourselves (in ASS?), which would be complicated again. I agree it's probably a good way to bring a lot of GUI-like functionality to mpv CLI, but on the other hand it furthers the "pretend being a GUI" issue. Anyway, if someone has a good Lua script for this, we could consider including it as builtin.

Splitting cplayer would not make that much sense, because the libmpv API uses a lot of cplayer functionality. Even the CLI output and the status line can be helpful for debugging libmpv things. This is just a consequences from the fact that mpv originated as CLI only application that was later turned into a library.

I don't really get those Retroarch ideas. Isn't it a game emulator frontend? How does that make it a good fit for a media player GUI?

@kkkrackpot
Copy link
Contributor

I'm not a developer and actually don't use any GUI with mpv. However, I'd say that having an official GUI seems beneficial as long as it allows to get rid of "pseudo-gui" features inside mpv (though personally i have no problems with "pseudo-gui" so far), and as long as gui development follows mpv development but not vice versa.

@sibwaf
Copy link

sibwaf commented Feb 9, 2018

As for me, existing OSC is good enough: mpv is excellent at keeping it lightweight, simple and persistent across different platforms. The only feature I'm lacking a lot at this moment is "boss key", which could be easily implemented with Lua scripts as long as #4661 is implemented. There is also file thumbnailing, but I imagine it is pretty hard to do this in a crossplatform way and there are applications for this anyway.

Main problem here is that text configuration might be too much for casual users and it scares a lot of people. As I see it, implementing an official GUI can help, but it seems like an overkill. Keeping a list of good enough applications on mpv.io (like Git does) would be pretty nice.

@The-Soulless
Copy link

I see no reason to create a GUI, I believe the current way is perfectly straight forward and easy enough even the average Windows user would figure it out pretty quickly.

@ghost
Copy link

ghost commented Feb 9, 2018

@wm4 There's really only 2 options here, neither of which involve using any of the existing frontends:

  1. Make a right click menu a permanent part of mpv, giving us all the major functionality, organized in a logical manner. This would be the simplest option for everybody.

  2. Create a VERY basic, multi-platform UI from scratch similar in design to MPC-HC/mpc-qt. The reason it has to be done from scratch is that the frontends you listed all have issues in some way and we will never get a consensus as to which one we can adopt as an official UI. It's best to start from scratch in the most basic way possible with direct input from the community. The only difficult part will be finding somebody willing to build out such a UI. If we can't find somebody to do that, we simply have to default to option 1.

@The-Soulless The average Windows users is a point and click person. They are not going to edit conf files unless they are an enthusiast who is more than willing to try new things, and such Windows users are rare. At the very least, Windows users need a right click menu in addition to the current OSD so they don't have to edit conf files. However, they would feel most at home with a basic UI that looks somewhat like Media Player Classic. Once a Windows user sees playback controls and drop down menus as soon as they fire up mpv, it will be nearly impossible for them to get confused. This is why we need to first consider making a basic UI from scratch and if that isn't possible, default to adding only a right click menu.

@wiiaboo
Copy link
Member

wiiaboo commented Feb 10, 2018

What would a right-click menu contain though? 200 options?

@Hrxn
Copy link
Contributor

Hrxn commented Feb 10, 2018

Taken from Google's Xi Editor project:

Design decisions

Here are some of the design decisions, and motivation why they should contribute to the above goals:

  • Separation into front-end and back-end modules. The front-end is responsible for presenting the user interface and drawing a screen full of text. The back-end (also known as “core”) holds the file buffers and is responsible for all potentially expensive editing operations.

  • Native UI. Cross-platform UI toolkits never look and feel quite right. The best technology for building a UI is the native framework of the platform. On Mac, that’s Cocoa.

[.....]

Against cross-platform UI, for Native UI, facing a similar problem.
I don't see how it should be possible to get around that, even aiming for a very basic, multi-platform UI.
Let's say we just start with a simple right-click/context menu, how should this be done in a straightforward cross-platform way? I would not know..

Personally I'd say that Qt is not too bad, but the habit of shipping each app with its own integrated Qt libs is absurd. It would be better if it were possible to use a system-wide Qt installation, but the problem is how to rely on that on different platforms, I guess. I haven't really seen this solved, and this should actually be the important first step.
It's really as they say, I guess. Pick your poison.

@SilverEzhik
Copy link

@cormak

Make a right click menu a permanent part of mpv, giving us all the major functionality, organized in a logical manner. This would be the simplest option for everybody.

Unless it only exposes a basic set of functionality, or some sort of a settings screen, it will become a submenu hell.

If it's the submenu system alone, it would be reasonable to basically expose the functionality bound to the keys, and more granular controls over things such as choosing audio tracks (showing all at once, as opposed to going through each one by one).

Create a VERY basic, multi-platform UI from scratch similar in design to MPC-HC/mpc-qt. The reason it has to be done from scratch is that the frontends you listed all have issues in some way and we will never get a consensus as to which one we can adopt as an official UI. It's best to start from scratch in the most basic way possible with direct input from the community. The only difficult part will be finding somebody willing to build out such a UI. If we can't find somebody to do that, we simply have to default to option 1.

We come back to the UI library problem. It's native or get out - dragging Qt or (god forbid) Electron in would be unreasonable.

The average Windows users is a point and click person. They are not going to edit conf files unless they are an enthusiast who is more than willing to try new things, and such Windows users are rare.

The way I see it, the average user you describe doesn't even care about whatever the config files offer. They open a file in mpv, play it, and go on with their lives. There is a discoverability problem in terms of keyboard shortcuts, but exposing all of mpv's hidden options all at once would turn the simple interface into hell.

At the very least, Windows users need a right click menu in addition to the current OSD so they don't have to edit conf files. However, they would feel most at home with a basic UI that looks somewhat like Media Player Classic. Once a Windows user sees playback controls and drop down menus as soon as they fire up mpv, it will be nearly impossible for them to get confused. This is why we need to first consider making a basic UI from scratch and if that isn't possible, default to adding only a right click menu.

Exposing config functionality via a right-click menu would get very messy - it would get big and painful to navigate.

@SilverEzhik
Copy link

The way I see it, there are three things that the hypothetical complete UI, if you really want to go down this route, would need to have.

  1. OSD

This already exists, and this is already good - don't do anything - maybe add a discoverability option to keep the OSD on-screen when paused.

  1. Right-click menu

This should expose the options offered by the default set of shortcuts, things like taking a screenshot, looping the video, and a few extra options for things like opening new files. Basically, this would be for non-persistent options, things you change for the current video/playlist.

  1. Settings screen

This is the place where the .conf functionality would be exposed, giving people control over that. These are the persistent options, and would be stored in the preferences.


Now, how this should be built is a better question. Right-click menu is simple enough - not worth bringing in a big UI toolkit in for a context menu. It can essentially be the same list for all platforms (or even something exposed as a separate config file). That'd take coming up with the list of menu items, then some per-platform code to draw the described menu with native Win32/Cocoa/GTK widgets. You could even add an API to let scripts add their own menu items.

The settings screen will be harder. Here's a sample of representative settings screens from various platforms:

Windows Word 2016

macOS Safari

GNOME Rhythmbox

Things are similar enough that you could, in theory, get away with the list of settings and the groups they belong to, then write some Win32/Cocoa/GTK code to make the settings window and draw the corresponding checkboxes and option pickers.

This settings screen could actually live in a separate executable - then in the actual mpv executable you'd just need a little piece of code that puts the "Settings" option in the right-click menu if mpv-settings or whatever the settings executable would be called exists.


That's the best approach to cross-platform UI that I can think of that also avoids the issues of non-native UX and of adding external UI toolkits as dependencies.

mpv's OSD already does a good enough job at exposing playback options, so it should just stay the way it is. A right-click menu would be nice to have, for improving discoverability of more interesting options that are currently only usable through keyboard shortcuts.

The one missing piece here is working with playlists - I never particularly did anything more advanced than queue a folder's worth of files to play, so I'll need some feedback from others on this. I would, however, advice against turning mpv into a full-blown media manager - as then the UI approach that I'm suggesting would quickly break down.

@ghost
Copy link

ghost commented Feb 10, 2018

@wiiaboo @SilverEzhik Have you guys even seen right click menus these days? The ones in popular players like VLC, MPC-HC, etc are all quite lengthy and do a lot. Also, playback functions should be left to the OSD, while everything else should go to the right-click menu. There's no point in putting play, stop or enable/disable subs in the right click menu. The point of the right click menu is to customize the player so that new users can tailor mpv to their hardware and make mpv behave the way they want.

I personally would prefer to create a brand new, basic, MPC-HC-like UI from scratch for all platforms with a dedicated settings screen, but if that isn't possible, you can easily create a right click menu by simply asking users what they are first most likely to change on a fresh install and using that data to narrow down all of mpv's options to a manageable size. I'd guarantee that people would be most likely to want to do things like enable HW acceleration, change the screenshot format to png, change the video output, change the number of audio channels, etc. Anything that is unlikely to be changed by most users would only be accessible by editing the conf file.

I think most people here can agree that the whole point of all this UI talk is to open mpv to a wider audience and this is easily achievable with a carefully handpicked and organized right click menu.

@SilverEzhik
Copy link

VLC is not exactly something to strive for, and it also does not expose the kind of settings that you suggest in its right-click menu - instead it exposes shortcuts to preferences and the per-video options in the vein of those I suggested.

enable HW acceleration, change the screenshot format to png, change the video output, change the number of audio channels

These are all already advanced options - which, while I agree with you could be exposed better, have no business in a right-click menu. Stick them in the settings screen.

The best thing about mpv as it is today, if you're the kind of person that does not care about customization, is that it's just the player screen, and that's it. I would advise against turning it into a big media machine in the vein of VLC or MPC-HC, with mountains of different modes and screens.

There is no need for complexity for the sake of complexity.

@ghost
Copy link

ghost commented Feb 10, 2018

VLC is not exactly something to strive for, and it also does not expose the kind of settings that you suggest in its right-click menu

@SilverEzhik VLC made the mistake of having its right click menu be mostly redundant by putting playback functions in the right click menu and MPC-HC goes even further and lets you change renderer settings. I think we should let the OSD do the playback work only, while the right click menu acts as a "quick configurator" for functions like changing the number of audio channels, and enabling hardware decoding.

I agree with you that mpv doesn't need to be made more complex, which is why both my options were to create a basic UI or a carefully crafted right-click menu, but if @wm4 is talking about a official GUI, even going so far as to suggest that one of the existing GUIs should be made the official GUI, we should try to steer things into the creation of a GUI more basic than existing GUIs or just adding a right click menu to keep things simple.

Also, I wouldn't call MPC-HC a "big media machine". MPC-HC was pretty lightweight. Moreso than VLC which is also a streaming solution. We should consider MPC-HC or the current MPC-Qt as a good example of what mpv should look like, and then try to make something even more lightweight than those examples.

I think the fact that @wm4 is open to adopting a GUI for mpv is enough motivation for somebody to start creating a completely new, from-scratch, basic GUI for mpv since it will become THE official GUI instead of yet another buggy, bloated frontend with no official support.

@kasper93
Copy link
Contributor

kasper93 commented Dec 11, 2023

https://github.com/tsl0922/mpv-plugin

Consider loading menu command list from config file and it should be pretty usable for anyone who wants such feature. Probably little bit more tricky to support nested list like audio tracks, but should be doable even in generic way.

(this was the only use-case why I added cplugin support on Windows, hoping someone will do the GUI enchantments)

EDIT: Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.

@stax76
Copy link
Contributor

stax76 commented Dec 11, 2023

My experience with the context menu in mpv.net is the following:

In v7 which is now available as beta version release, I made a large change to how the context menu works, it's documented in the manual:

Before version v7 all bindings and the context menu definition
was contained in the input.conf file, which mpv.net created
in case it didn't exist. This had the disadvantage that mpv.net
lost control over all default bindings and the context menu
defaults. This was unfortunate, v7 introduces a new design
fixing it.

In v7 no input.conf file is created, the default bindings and
context menu is defined internally. input.conf only contains
what is different from the internally defined defaults,
so it's the same how mpv is used.

For backward compatibility the old input.conf format with the
menu definition using #menu: is still supported. The new
design also allows for a menu customization, in a sub section
called Custom. In input.conf it can be defined like so:

Ctrl+a show-text Test #custom-menu: Test > Test

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 12, 2023

Consider loading menu command list from config file

@kasper93 It's supported now. The syntax is taken from mpv.net by @stax76, so you can just drop an input.conf from mpv.net to test it.

@butterw
Copy link

butterw commented Dec 12, 2023

tsl0922: can you provide a build of your plugin ?

@stax76
Copy link
Contributor

stax76 commented Dec 13, 2023

@kasper93 It's supported now. The syntax is taken from mpv.net by @stax76, so you can just drop an input.conf from mpv.net to test it.

Find it here:

https://github.com/mpvnet-player/mpv.net/blob/40565e8b3d3b65173ca4aa3f4b7f2b55c65f0114/src/Resources/input.conf.txt

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 13, 2023

tsl0922: can you provide a build of your plugin ?

You can download from the Actions Artifacts. This plugin is still in ealy development, once the basic functionality is implemented, I will publish a Release soon. (currently missing features: open dialog, nested list like audio tracks)

@stax76
Copy link
Contributor

stax76 commented Dec 13, 2023

If you need dark mode code, I have this code here:

https://github.com/stax76/Everything.NET/blob/master/src/ShellDarkMode.cs

I have this code from the MSYS2 terminal code, it supports a dark mode Win32 context menu. I cannot find this code now.

@stax76
Copy link
Contributor

stax76 commented Dec 16, 2023

I currently work on a libplacebo GUI, the necessary code is done, which means I can now define the GUI in INI format.

Screenshot (3)

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 17, 2023

Support for nested lists like tracks/chapters/... are added for the contextmenu plugin now. The menu syntax is documented in the project README.

I've tagged a dev build for anynoe who want to try: https://github.com/tsl0922/mpv-plugin/releases/tag/dev

@butterw
Copy link

butterw commented Dec 17, 2023

What are the mpv version requirements to be able to use the menu plugin ?
Does it only work with mpv x64 v3 Shinchiro v0.37 ?

As mentionned in the readme, you now need to add a keybinding for the menu to show up, ex, input.conf:
MBTN_RIGHT script-message-to menu show

@stax76
Copy link
Contributor

stax76 commented Dec 17, 2023

Maybe better to rename it to mpv-menu-plugin or if you want to do more mpv-gui-plugin.

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 18, 2023

Does it only work with mpv x64 v3 Shinchiro v0.37 ?

the cplugins support for windows was added in 0.37.0.
shinchiro build is not a requirement, but the the cplugins feature must be enabled when compile mpv.
I have updated the project README for mpv requirement.

Maybe better to rename it to mpv-menu-plugin

done

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 18, 2023

Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.

@kasper93 now the code is over 500 lines, most of them are handing property change and menu update. so if we are going to upstream this feature, I would recommend moving the menu update logic to a scriptable language:

  • mpv: watch the menu definition from a property, create menu on the fly
  • lua: a user may set the property to create/update menu definition

then we can create a lua plugin that can load mpvnet or uosc style menu definitions from input.conf, or just create any custom menu items the user wants with code.

BTW: we can extend the support for this menu definition property to any other platforms later too (my plugin is windows only).

@tsl0922
Copy link
Contributor

tsl0922 commented Dec 19, 2023

You can now use the Debug tool from ImPlay on mpv as a cplugin:

  • Visual view of mpv's internal properties
  • Console with completion, history support
  • Colorful mpv logs view with filter support

https://github.com/tsl0922/mpv-debug-plugin

@butterw
Copy link

butterw commented Dec 28, 2023

Request for a simple modern seekbar
mpv should provide an option for a simple clean hidable seekbar (nice looking, usable in a small window, some configuration options, no extra features) and neither osd-bar nor OSC can currently achieve this. I haven't seen it done in user scripts either. Some OSC replacement can provide a modern seekbar, but they tend to be bloated and broken at ex: 3000 lines of lua code.

@Kagami
Copy link
Contributor

Kagami commented Jan 10, 2024

#5500 (comment)
Many have built a frontend, with an own main window implementation, which has the huge disadvantage of loosing all the rich cross-platform window functionality mpv already has.

I agree, it seems too much work to build frontend for every platform, especially because mpv already works on many platforms, so it feels unnecessary. Most devs nowadays use Electron and Qt for cross-platform apps (that work on Windows, Linux and macOS) but both doesn't feel very nice and people would switch to another app once it's available. (With VS Code being the only major exception.)

So the extension approach seems better. So considering this, is anyone aware of some kind of Lua-widgets-for-mpv effort (or JavaScript)?

I've looked into existing Lua user scripts with a lot of GUI elements and found:

  • built-in osc.lua, 3k lines (and also many forks listed here)

This doesn't look very reusable. If someone wants to re-create similar UI, they would need to just copy it and heavily modify all over the place.

This looks better, I had something like that in mind regarding "Lua widgets". But again, not sure how reusable those Lua modules are.

Does anybody know similar projects?

@tsl0922
Copy link
Contributor

tsl0922 commented Jan 14, 2024

Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.

@kasper93 now the code is over 500 lines, most of them are handing property change and menu update. so if we are going to upstream this feature, I would recommend moving the menu update logic to a scriptable language:

  • mpv: watch the menu definition from a property, create menu on the fly
  • lua: a user may set the property to create/update menu definition

then we can create a lua plugin that can load mpvnet or uosc style menu definitions from input.conf, or just create any custom menu items the user wants with code.

BTW: we can extend the support for this menu definition property to any other platforms later too (my plugin is windows only).

It is implemented as v2 version now, The core C code that render menu from mpv user property is about 150 lines (excluding the menu syntax parsing logic, can be move to lua later).

@butterw
Copy link

butterw commented Jan 20, 2024

On windows (win32 native) c-plugins seems to be the right approach for GUI elements.

Open File Dialog + copy/paste strings to Clipboard have just been added to mpv-menu-plugin in latest actions builds:
tsl0922/mpv-menu-plugin@f396ed1

@tsl0922
Copy link
Contributor

tsl0922 commented Jan 23, 2024

tsl0922: can you provide a build of your plugin ?

You can download from the Actions Artifacts. This plugin is still in ealy development, once the basic functionality is implemented, I will publish a Release soon. (currently missing features: open dialog, nested list like audio tracks)

With the 2.2.0 release, the open dialog and clipboard support was added now, and all the features provided by mpv-menu-plugin are Scriptable (You can modify menu with script, or even update menu state in input.conf with lua expression).

You should give it a try, if you want better native gui experience for vanilla mpv on Windows.

Tip

Why do you add dialog / clipboard support again? There're scripts like mpv-open-file-dialog / mpv-clipboard already!

These scripts are both using PowerShell to implement features on Windows, There may be 1s or above cold start delay on the first time. Another feature that is not supported by the PowerShell Get-Clipboard is tsl0922/mpv-menu-plugin#41.

@Kagami
Copy link
Contributor

Kagami commented Jan 30, 2024

#5500 (comment)

So considering this, is anyone aware of some kind of Lua-widgets-for-mpv effort (or JavaScript)?

@ahaoboy just implemented exactly that in mpv-easy. Amazing!

@Solarunit
Copy link

Solarunit commented Feb 2, 2024

I just found this uosc UI (sorry if it was already mentioned before)
It looks very good in the demo, especially menus in the center.
I think something like this would be nice to have as official GUI, maybe disabled by default, but easly activated from the config (maybe shortcut?) or some button from the current GUI.

uosc.webm

https://github.com/tomasklaen/uosc

@ahaoboy
Copy link

ahaoboy commented Feb 3, 2024

I just found this uosc UI (sorry if it was already mentioned before) It looks very good in the demo, especially menus in the center.

UOSC is indeed the most comprehensive functionality in Lua scripts. Inspired by it, I have implemented a toolkit mpv-easy using TS and React, which also supports right-click menus and playlist. Although the project is still in its early stages, I believe this approach can bring new ideas to MPV scripts.
click-menu

@mpv-player mpv-player locked and limited conversation to collaborators Apr 16, 2024
@kasper93 kasper93 converted this issue into discussion #13901 Apr 16, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests