Add the option to append media to playback queue instead of playing media instantly
Add option for the user to add files to a playback queue when dragging and dropping files/URLs on to mpv or launching a new mpv with a command line switch which will add media to the playlist of an already running mpv process.
Right now there doesn't seem to be an option to change the default behaviour of mpv if a file/URL should be dropped on to it. Case in point:
Thanks!
I second this. It would remove half the motivation for a playlist gui. Currently, all but the simplest playlists (all files in same directory) are impossible to build except from the command line.
How about making this use a modifier key? Normal dropping replaces, dropping with Shift pressed adds?
Or, to make it a bit more intuitive, make the OSC show visual hints, e.g. so that depending on which part of the screen the files are dropped in, mpv will replace the playlist and start playing instantly, or add them to the current playlist, or something else…
I may or may not be volunteering. Does the API expose something like a drag-enter event yet?
Does the API expose something like a drag-enter event yet?
No.
now we are starting to escalate things a bit ...
And this should probably also work without the OSC.
So, what do you want?
I think it would be sufficient to interpret drags into a window already playing something as enqueue. It could be an opt-in command line / config option if there is desire to maintain the old behaviour.
I would like to see an append-play command for mpv directly (to be used via DnD on a .desktop launcher Though admittedly that would be of limited user base useability
The command exists, it's just not used by the drop code. (Actually it does use it if multiple files are dropped: for each file a loadfile command is run, and only the first file wipes the previous playlist.)
Wow, that was easy
- (i == 0) ? "replace" : "append",
+ (i == 0) ? "append-play" : "append",
On the other hand if this should not be the default behaviour, we need either a modifier key (+ modiified event) or an option. Opinions?
I'd be fine without any further changes than that. The drawback might be that dragging files to a playing window gives no notification that the files were added to the play list. Should there be some sort of osd notification?
above works fine here when mpv is started on a playlist or at least 2 files. So dumb ? of the month - is there anyway to have this work when mpv is opened on a single file? (- I guess for opening via the .desktop I could add /dev/null to the Exec= line though maybe that's a poor idea..
@mc4man I don't understand.
Are you saying that the above doesn't work when mpv is started with mpv file.mkv? What happens then?
Ok , re- checking, if starting with a single file it does 'work' - [cplayer] Run command: loadfile, flags=1, args=[file:///home/doug/Videos/amostviolentyear-clip1_h1080p.mov, append-play, ] but I have to wait until the 1st. file finishes. (no playlist arrows in Osc) or use a keyboard binding If mpv is started with 2 files then those & any DnD files can be switched at will from those little arrows in the Osc So I guess that was what I was looking for from a single file, ie. the Osc playlist arrows.., sorry about my confusion here.
Ot - is there anyway to stop the 'spamming' when using -v from simple cursor movement in window? (- [cplayer] Run command: ignore, flags=9, args=[] & if exposing the Osc [cplayer] Run command: script-binding, flags=9, args=[osc/__keybinding1] [cplayer] Run command: script-binding, flags=9, args=[osc/__keybinding2]
I see what you mean. So the OSC doesn't get updated by the drop event I guess.
Looks like once the next file is loaded the arrows appear.
There doesn't seem to be a documented event that the osc could listen to for this. file-loaded sounds like the new file has to start playing.
adding to osc.lua
mp.observe_property("playlist", nil, request_init)
seems to cause the arrows to appear right away.
So I see the following possibilities:
- we switch to the new behavior, and the old behavior is not possible anymore
- we make it configurable
- something with shift modifiers deciding the behavior or so
- somehow implement it in the OSC
I don't like 2. input.conf is not flexible enough for this (unless you have a suggestion), and I'd like to avoid another global config option. Plus, I can't imagine anyone actually bothering to find and use this setting.
We could do 3., which would be pretty simple, but also requires modifications in 4 platform backends (x11, wayland, osx, win).
Option 4 would implement it in the OSC and possibly allow fancy interactions (like visually indicating the action the drop will have), but it also sounds very complicated, and I don't volunteer to do the osc.lua part of the implementation.
I like 1 but obviously a certain % would disagree & want a new DnD to start immediately. 3 seems ok, again here would prefer the modifier to be for 'old' behavior as I'd take a guess the majority would like the 'new' behavior. (- I could do a quick test & push new behavior to one ppa & see how many complaints I get (or you get.. Right now I'd say there are 1400 or so very active users so that's not a huge sampling but could be representative
-
will probably get some people angry "MAKE IT CONFIGURABLE!!11"
-
(global config option) or 3) sound like the best solutions to me.
-
would shut out all people who disable the OSC, besides sounding like a bit much of a PITA to implement.
3 would without doubt result in people requesting a config option to reverse the shift/no-shift behavior.