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

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.

# `lang_codes`

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

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

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.

---

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