Giter VIP home page Giter VIP logo

Comments (9)

Argon- avatar Argon- commented on August 21, 2024

Just for clarification: not my script. It was written bu someone else as indicated in the first line.

Now as for your problem, to be honest I've never noticed this and will need to test it first. I feel like I've used it in the past to seek "back" to the start of a file but I might remember it wrong.
Interestingly, looking at the script (I'm on my phone, no mpv available) it should actually work. Are you sure you are within the first chapter already?

from mpv-config.

Argon- avatar Argon- commented on August 21, 2024

Just tested it and I can't reproduce your problem. Works for me.

from mpv-config.

kesdoputr avatar kesdoputr commented on August 21, 2024

It's strange~~i test again and get the same result.
When the file's chapter 1 is not at 00:00:00 i can't use hotkey back to file start.
I'm using mpv x64 at windows 7 SP1 X64

PS.I test with no other config, just compare with betterchapters.

from mpv-config.

Argon- avatar Argon- commented on August 21, 2024

How do you bind the script to a key? By editing the script file or with input.conf?

from mpv-config.

kesdoputr avatar kesdoputr commented on August 21, 2024

I try both method
●edit the script directly

mp.add_key_binding("@", "chapterplaylist-next", function() chapter_seek(1) end)
mp.add_key_binding("!", "chapterplaylist-prev", function() chapter_seek(-1) end)

●use the setting in your input.conf

z      script-binding betterchapters/chapterplaylist-next #; show-text "${?chapter:Chapter: ${chapter}}"
Z      script-binding betterchapters/chapterplaylist-prev #; show-text "${?chapter:Chapter: ${chapter}}"

But i get the same result, i can only back to the first chapter, then show the playlist.

from mpv-config.

kesdoputr avatar kesdoputr commented on August 21, 2024

It seems that, for example:
●Chapter 1 start at 00:00→will treat it to chapter0, so chapter+direction < 0→go to previous file
●Chapter 1 start at 05:00→will still treat it to chapter0, so chapter+direction < 0→go to previous file
(but i need it go to the file start)

from mpv-config.

kesdoputr avatar kesdoputr commented on August 21, 2024

I try to add two line

local timepos = mp.get_property_number("time-pos")
if chapter+direction < 0 and timepos <= 5 then

And it seems ok now, when time over 5secs will first go to filestart(chaper 0)

from mpv-config.

Argon- avatar Argon- commented on August 21, 2024

Now I get it.
An alternative would be to set the 0 to -1 but then you can't go back to the start of a file.
I assume this was the reason it was done like that. Without an "heuristic" (like your 5 seconds) you need to choose between "not being able to go to a previous file" and "not being able to seek to the start of your current file".
I suppose those 5 seconds will work fine but when chapters are shorter or start later, then there will be problems. Not sure if such files exist though.

from mpv-config.

kesdoputr avatar kesdoputr commented on August 21, 2024

You are right, if there has a chapter shorter then 5sec, i can only back to this chapter and then goto previous file, but now seems work for most conditions.
Thanks for your reply, i wil close this issue first :)

from mpv-config.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.