# `Laev.VLC`
[🔗](https://github.com/alexdont/laev/blob/main/lib/laev/vlc.ex#L1)

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.

# `launch_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`

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
