-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to prevent autoloading next file (for playlists) #4738
Comments
|
Thank you, this works. My only gripe is that loading the next file keeps the player in a "paused" state. Is there a way to force it to play instead? |
|
Great! Now combined with autoload script, it behaves almost like MPC-HC. :) Another question, if the file is paused at the end (on the last frame), can pressing play restart the playback (i.e. automatically seek to the beginning and play)? |
You'll need a custom keybind in
Curiously, I opened an issue with the exact same question back in the day :) |
Cool, that keybind method does the trick. :) Still would be better if mpv handled it automatically. I don't suppose there's a way to make the "skip to next chapter" keybind also skip to the next file if you're on the last chapter? Or should I request it? |
I don't think you can do that with keybinds alone. Take a look at the user-scripts section of the wiki for possible solutions/ideas. |
function chapter_seek(direction)
local chapters = mp.get_property_number("chapters")
if chapters == nil then chapters = 0 end
local chapter = mp.get_property_number("chapter")
if chapter == nil then chapter = 0 end
if chapter+direction < 0 then
mp.command("playlist_prev")
mp.commandv("script-message", "osc-playlist")
elseif chapter+direction >= chapters then
mp.command("playlist_next")
mp.commandv("script-message", "osc-playlist")
else
mp.commandv("add", "chapter", direction)
mp.commandv("script-message", "osc-chapterlist")
end
end
mp.add_key_binding("PGUP", "chapter_next", function() chapter_seek(1) end)
mp.add_key_binding("PGDWN", "chapter_prev", function() chapter_seek(-1) end) |
I'm not qualified either way to say, but whatever, it looks very neat to me @wiiaboo |
Hey that works, much obliged @wiiaboo. 😄 Guess that answers all my questions for now. Thnx to all. |
Hi! Is it possible to make @wiiaboo's function display the OSD bar? |
@wiiaboo Any way to also go to the previous file if "skip to previous chapter" is used very close to the first chapter? Tto make it act like MPC-HC. |
How to go to next file if the current file has no chapters? |
I need help, i'm trying in every way possible to do something simple, pause mpv if it encounters a chapter, that's it, i want to make it so that if mpv encounters a chapter it pauses and i can unpause it with a hotkey, can you help me? |
mp.observe_property('chapter', 'native', function (_, chapter)
if chapter and chapter > 0 then
mp.set_property_native('pause', true)
end
end) |
Thank you so much! |
How to make it work for files with no chapters? EDIT: It already do lol, I was forgetting to edit the keybindings. |
How to keep the OSD still showing chapter switching messages? |
|
Opening up playlists gives me the nice ability to use hotkeys to play the next/prev file in the folder manually. But is there some way I can prevent mpv from advancing to the next entry automatically within a playlist? I want to keep the player paused on the last frame, and only advance when I need it to (with simple hotkey).
The text was updated successfully, but these errors were encountered: