EN
apps/winzik / src / Cast / CastTarget.php · commit 6576d6f
<?phpnamespace App\Cast;/** * What plays on the TV: a DLNA renderer (DlnaTarget), a Google Cast device (CastClient: the Default Media Receiver or * WinZik's own receiver page), or WinZik's TV page in any browser (TvTarget). CastSession drives one, never waiting. * * $song: id (int), url (the song on WinZik's LAN server), mime, title, artist, album, cover ('' none), duration (s), * vtt (the lyrics as WebVTT subtitles, '' none), lyrics (the URL of the lyrics JSON of the TV page, '' none). */interface CastTarget{    /** @param array<string, mixed> $song */    public function load(array $song, float $at, bool $play): void;    public function play(): void;    public function pause(): void;    public function seek(float $seconds): void;    public function stop(): void;    /** 0..100 */    public function setVolume(int $volume): void;    /** Each frame. */    public function poll(): void;    /**     * What the TV says now. state: connecting | loading | playing | paused | idle | lost (no answer) | closed (the TV     * ended it); position: seconds (null unknown); song: the id of what it plays (-1 unknown).     * @return array{state: string, position: ?float, song: int}     */    public function status(): array;    /** The last problem, in French ('' none). */    public function error(): string;    public function close(): void;}