-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
72 lines (70 loc) · 1.79 KB
/
index.d.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
61
62
63
64
65
66
67
68
69
70
71
72
declare module "@byron-react-native/dlna-player" {
import { ViewProps, NativeEventEmitter } from "react-native";
export interface VlcEvent {
/**
* 已播时长(毫秒ms单位)
*/
currentTime: number;
/**
* 总时长(毫秒ms单位)
*/
duration: number;
/**
* 进度
*/
position: number;
type: EventType;
}
export interface VlcSource {
uri: string;
options?: Array<string>;
}
export enum ScaleType {
SURFACE_BEST_FIT,
SURFACE_FIT_SCREEN,
SURFACE_FILL,
SURFACE_16_9,
SURFACE_4_3,
SURFACE_ORIGINAL,
}
export enum EventType {
Buffering = 259,
EncounteredError = 266,
EndReached = 265,
Playing = 260,
Paused = 261,
PositionChanged = 268,
Stopped = 262,
}
export interface VlcProps extends ViewProps {
source: VlcSource;
time: number;
rate: ScaleType;
paused: boolean;
aspectRatio: string;
volume: number;
onBuffering: () => void;
onError: () => void;
onEndReached: () => void;
onPlaying: (event: VlcEvent) => void;
onPaused: () => void;
onProgress: (event: VlcEvent) => void;
onStopped: () => void;
onEventVlc: (event: VlcEvent) => void;
}
type INativeProps =
| { time: number }
| { rate: ScaleType }
| { paused: boolean }
| { aspectRatio: string }
| { volume: number };
export class ByronPlayer extends React.Component<Partial<VlcProps>> {
setNativeProps(nativeProps: INativeProps): void;
}
export function startService(serverName: string): void;
export function closeService(): void;
export function isInstalledApp(bid: string): Promise<boolean>;
export function startApp(bid: string): void;
export const dlnaEventName = "dlna-player";
export const ByronEmitter: NativeEventEmitter;
}