I’m trying to make a VLC script that checks if the "random" button is on, and if so when it jumps to a random file, instead of starting at time=0, it starts at a random time.
So far, it’s looking to me like it should be a playlist script and I can get the duration from the playlist object, but in this documentation page doesn’t show how to jump to a specific time from within the Lua script.
How can that be done in Lua?
Actually, the documentation does say you can do it…though not in so many words. Here’s what it says about the interface for playlist parsers:
If you follow through to the description of
playlist.add()it says the items have a big list of fields you can provide. There are plenty of choices (.name,.title,.artist, etc.) But the only required one seems to be.path…which is “the item’s full path / URL”.There’s no explicit mention of where to seek, but one of the parameters you can choose to provide is
.options, said to be “a list of VLC options. It givesfullscreenas an example. If a parallel to--fullscreenworks, can other command-line options like--start-timeand--stop-timework as well?On my system they do, and here’s the script!