forked from THEOplayer/react-native-theoplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CastEvent.ts
45 lines (34 loc) · 958 Bytes
/
CastEvent.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import type { CastState, ChromecastError } from 'react-native-theoplayer';
export const CastEventNames = [
/**
* Dispatched when the ChromeCast state was changed.
*/
'chromecaststatechange',
/**
* Dispatched when the Airplay state was changed.
*/
'airplaystatechange',
/**
* Dispatched when an error occurred when using Chromecast.
*/
'chromecasterror',
] as const;
export type CastEventType = typeof CastEventNames[number];
export interface CastEvent {
/**
* Type of ad event.
*/
readonly type: CastEventType;
}
export interface ChromecastChangeEvent extends CastEvent {
readonly type: 'chromecaststatechange';
readonly state: CastState;
}
export interface AirplayStateChangeEvent extends CastEvent {
readonly type: 'airplaystatechange';
readonly state: CastState;
}
export interface ChromecastErrorEvent extends CastEvent {
readonly type: 'chromecasterror';
readonly error: ChromecastError;
}