-
Notifications
You must be signed in to change notification settings - Fork 4
/
Types.ts
60 lines (49 loc) · 1.64 KB
/
Types.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { VideoJsPlayerOptions } from "video.js";
import { CombinePlayerStatus, AtomPlayerStatus } from "./StatusContant";
export interface VideoOptions extends VideoDefaultOptions {
readonly url: string;
}
export interface VideoDefaultOptions {
readonly videoDOM?: HTMLVideoElement;
readonly videoJsOptions?: VideoJsPlayerOptions;
}
export type AtomPlayerStatusPair = {
readonly whiteboard: AtomPlayerStatus;
readonly video: AtomPlayerStatus;
};
export type AtomPlayerStatusCompose = {
previous: AtomPlayerStatusPair;
current: AtomPlayerStatusPair;
done: AnyFunction;
};
export type AnyFunction = (...args: any[]) => any;
export type PublicCombinedStatus =
| CombinePlayerStatus.PauseSeeking
| CombinePlayerStatus.PlayingSeeking
| CombinePlayerStatus.Pause
| CombinePlayerStatus.PauseBuffering
| CombinePlayerStatus.PlayingBuffering
| CombinePlayerStatus.Playing
| CombinePlayerStatus.Ended
| CombinePlayerStatus.Disabled;
export type LockInfo = {
isLocked: boolean;
allowStatusList: readonly CombinePlayerStatus[];
unLockStatusList: readonly CombinePlayerStatus[];
};
export type AtomPlayerStatusTransfer = {
current: AtomPlayerStatus;
previous: AtomPlayerStatus;
};
export type CombinePlayerStatusTransfer = {
readonly previous: CombinePlayerStatus;
readonly current: CombinePlayerStatus;
};
export type StatusChangeHandle = (status: PublicCombinedStatus, message?: string) => any;
export interface CombinePlayer {
setOnStatusChange(cb: StatusChangeHandle): void;
getStatus(): PublicCombinedStatus;
play(): void;
pause(): void;
seek(ms: number): void;
}