Laev.VLC (laev v0.1.40)

Copy Markdown View Source

Playing through VLC instead of mpv, and knowing where you got to.

mpv carries a Lua script laev writes on every launch: it saves the position every five seconds, counts the seconds actually watched as against seeked past, and appends the day's total to the log the heatmap is drawn from. VLC has no equivalent — scripts there are installed into the application, not handed to it at launch — but it does have a web interface, and that reports the playhead. So laev starts VLC with that interface bound to localhost on a random port behind a random password, and polls it on the same five-second cadence the Lua script uses, writing the same three files by the same rules.

Which means everything downstream carries on working unchanged — resume, Up Next, the watched ticks, the stats, the heatmap, MyAnimeList scrobbling — because all of it reads those files and none of it knows which player wrote them.

Two things don't come across, both of them mpv scripts rather than playback: skipping intros, and the stinger prompt. laev says so when you switch.

Summary

Functions

Arguments for a VLC launch: the web interface it is tracked through, the language preferences, any external subtitle, and where to start.

Follow the playhead for as long as VLC is up, writing what mpv's script would have written. Returns immediately; the watching happens in its own process, which ends when VLC does.

Functions

launch_args(ctx, extra_args)

Arguments for a VLC launch: the web interface it is tracked through, the language preferences, any external subtitle, and where to start.

Returns {args, resume_at, tracking} — tracking is what track/3 needs to find the interface again.

track(ctx, arg2)

Follow the playhead for as long as VLC is up, writing what mpv's script would have written. Returns immediately; the watching happens in its own process, which ends when VLC does.