| 16 | } |
| 17 | |
| 18 | export interface ICastDestination { |
| 19 | initialize(): Promise<boolean>; // returns if the cast destination can be used |
| 20 | type: CastDestinationType; // type of cast destination |
| 21 | |
| 22 | isAvailable: boolean; // can we use the cast destination |
| 23 | isConnected: boolean; // is the cast destination actively sharing |
| 24 | |
| 25 | currentTime: number | null; // current seek time the player is at |
| 26 | duration: number | null; // duration of media |
| 27 | |
| 28 | receiverName: string | null; // name of the cast destination |
| 29 | castState: CastState; // current state of the cast destination |
| 30 | |
| 31 | loadMedia(mediaUrl: string, sessionKey: string, reload: boolean): Promise<void>; // load media to the cast destination |
| 32 | |
| 33 | // remote player controls |
| 34 | play(): void; |
| 35 | pause(): void; |
| 36 | seekTo(time: number): void; |
| 37 | disconnect(): void; |
| 38 | } |
| 39 | |
| 40 | class CastManager { |
| 41 | private castDestinations = $state<ICastDestination[]>([]); |
no outgoing calls
no test coverage detected