-
Notifications
You must be signed in to change notification settings - Fork 47
Play next/previous video in folder #144
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
Play next/previous video in folder #144
Conversation
By default, PgDown and PgUp will play the next/previous video in folder if there's no more chapter and there's only one file in the playlist. With the renamed "Play next file in folder when there is only one item in the playlist" option enabled, the next file in folder will play without pressing anything when the end of the file is reached and the playlist has only the current file.
|
|
|
I'm thinking about adding key shortcuts to open the next/previous file in folder even if there are more chapters after, I think MPC-HC has this. Maybe "Play next file in folder when there is only one item in the playlist" could be renamed to something like "Play automatically next file in folder when there is only one item in the playlist" to make it clearer that the next file will play... automatically. |
Yes it could be removed. There used to be some obscure mode where a file could be played without it landing in the playlist, but it's gone now.
If there's something MPC-HC is doing that we aren't, I consider it a bug unless there's a good reason why we can't/don't.
I'm not against this. It is also possible to add a separate option (default on) for controlling whether automatic file progression is active or not. |
Don't close the file at the end, just pause the player, like MPC-HC. This allows manually opening the next file when the playing stopped at the end, seeking back, and being able to see we've reached the end. Wait for playlength to change before updating recents. This avoids using the length of the previous file for the current one or using -1 as the length. Since the length is set to -1 when opening a file before being set to its actual size, the recents are updated even if the next file has the same length (first to -1 then to real length).
f9f6e6d to
f4cd624
Compare
I've just checked it out: it opens the next/previous file in playlist or, if there's only one, the next file in folder with Ctrl+PgDown and Ctrl+PgUp by default.
By "automatic file progression", do you mean playing the next file in folder without user interaction? So I was thinking about an option to open the next file in folder manually (enabled by default) and an option to open it automatically (disabled by default). |
Opens the previous/next file in playlist or, if there's only one in it, the previous/next file in folder.
I was speaking in general (both playlist and folder) in relation to the existing code. But you're right MPC-HC doesn't do that, it should be changed to match. Playlists without automatic playlist progression doesn't make sense anyway.
It's clear enough. You could also go with "Use next file in folder when there is only one item in the playlist" (enabled by default, as you said) and "Wait for navigation when there is only one item in the playlist" (enabled by default). I'll leave this up to you. |
MPC-HC actually uses the equivalent of this Playback option we talked about in the issue to enable or not the auto play next file in folder: And it does it this way: first the files of the playlist, then the files in the folder. MPC-QT does the same with the equivalent setting. |
Yes it would indeed. In fact I noticed when writing the code for "default after playback" (added much later) that I was stomping on my own foot having a semi-related option in the tweaks page, so I had to write it such a way that certain actions were invoked by multiple options, certain options took priority, and so on. |
Play automatically next item of playlist. Rename folder fallback option to "Use next/previous file in folder when there is only one item in the playlist" and make it work like so.
|
Now what remains to be done is the ability to play the next file in folder after the playlist is finished (and empty the playlist). Both with autoplay and with manual input. MPC-HC does empty the playlist and plays the file - that follows the last one played - found the directory. If that's a real use case, I think it would be better to add a command to empty the playlist, which would allow continuing playing the files in the folder. |
This is a concern, yes. I know of at least one mpv dev who uses mpc-qt to play their 10000-file-strong music collection that I presume is spread over multiple folders, so this is probably not desirable. Adding so many files back would be a pain for them.
To support the existing use-case, there would have to be an option to turn it off I think. |
|
An option to turn off the command? |
|
Yeah I'm fine with that. |
Rename "Play next in the folder" to "Play next file" Rename "After Playback: Play next file in the folder" to "After Playback: Play next file" (HTTP)
|
There's still one thing missing: the ability to play again the same file by pressing Play when at the end. |
Restore MpvObject::eofReached() and use it to check if we're at the end. If so, seek back to the start before unpausing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll do some testing and merge it in the morning if that's okay with you.
By default, PgDown and PgUp will play the next/previous video in folder if there's no more chapter and there's only one file in the playlist.
With the renamed "Play next file in folder when there is only one item in the playlist" option enabled, the next file in folder will play without pressing anything when the end of the file is reached and the playlist has only the current file.
Fixes #137