forked from chaimPaneth/react-native-jw-media-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
78 lines (76 loc) · 2.34 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
73
74
75
76
77
78
declare module "react-native-jw-media-player" {
import React from "react";
import { ViewStyle } from "react-native";
interface PlaylistItem {
mediaId?: number;
time?: number;
adVmap?: string;
adSchedule?: { tag: string; offset: string };
desc?: string;
file?: string;
image?: string;
title?: string;
autostart?: boolean;
controls?: boolean;
displayDescription?: boolean;
displayTitle?: boolean;
repeat?: boolean;
}
interface PropsType {
mediaId?: number;
file?: string;
title?: string;
image?: string;
autostart?: boolean;
time?: string;
desc?: string;
controls?: boolean;
repeat?: boolean;
displayDescription?: boolean;
displayTitle?: boolean;
playlistItem?: PlaylistItem;
playlist?: PlaylistItem[];
nestUpDisplay: boolean;
style?: ViewStyle;
playerStyle?: any;
colors?: any;
nativeFullScreen?: boolean;
fullScreenOnLandscape?: boolean;
landscapeOnFullScreen: boolean;
portraitOnExitFullScreen: boolean;
exitFullScreenOnPortrait: boolean;
onPlaylist?: (playerlist: playlistItem[]) => void;
onPlayerReady?: () => void;
onBeforePlay?: () => void;
onBeforeComplete?: () => void;
onComplete?: () => void;
onPlay?: () => void;
onPause?: () => void;
onSeek?: (seek: { position: number; offset: number }) => void;
onSeeked?: (seeked?: { position: number }) => void;
onSetupPlayerError: (setupPlayerError: { error: string }) => void;
onPlayerError: (playerError: { error: string }) => void;
onBuffer: () => void;
onTime: () => void;
onFullScreenRequested: () => void;
onFullScreen: () => void;
onFullScreenExitRequested: () => void;
onFullScreenExit: () => void;
onPlaylistComplete: () => void;
onPlaylistItem: (playlistItem: any) => void;
}
export default class JWPlayer extends React.Component<PropsType> {
seekTo(index: number): void;
play(): void;
pause(): void;
stop(): void;
playerState(): Promise<number | null>;
position(): Promise<number>;
toggleSpeed(): void;
setPlaylistIndex(index: number): void;
setControls(shouldDisplayControl: boolean): void;
setFullscreen(shouldDisplayInFullScreen: boolean): void;
loadPlaylist(playlist: PlaylistItem[]): void;
loadPlaylistItem(playlistItem: PlaylistItem): void;
}
}