Laev.Player (laev v0.1.40)

Copy Markdown View Source

Launches an external desktop player for a stream URL.

Only works when the Phoenix server runs on the same machine as the browser (the localhost use case this app is built for). GUI apps are opened with macOS open -a; mpv (a CLI binary) is launched detached so it keeps running without blocking the caller. In every case the URL is passed as a separate argument, never interpolated into a shell command.

Summary

Functions

Comma-separated language codes (all tagging variants) for an ISO code.

Hand a magnet link to the OS default handler (the user's torrent client) — a way to download DMCA'd/uncached torrents directly via P2P, bypassing RD.

Play url in whichever player is configured, for the thing ctx describes.

Functions

lang_codes(lang)

Comma-separated language codes (all tagging variants) for an ISO code.

open_magnet(magnet)

Hand a magnet link to the OS default handler (the user's torrent client) — a way to download DMCA'd/uncached torrents directly via P2P, bypassing RD.

play(ctx, url, extra_args)

Play url in whichever player is configured, for the thing ctx describes.

The only way in, deliberately: when launching took a player name, four call sites passed :mpv, and the one missed was Continue — where most films start.

The arguments are built for mpv, because mpv is the default and most of them are its scripts and script options. VLC takes the two that mean anything to it — the stream and any external subtitle — and gets its position tracked from outside instead. Everything downstream reads the same files either way.