forked from cookpete/react-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
106 lines (93 loc) · 2.24 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import * as React from 'react';
export interface SourceProps {
src: string;
type: string;
}
export interface TrackProps {
kind: string;
src: string;
srcLang: string;
default?: boolean;
}
export interface SoundCloudConfig {
options?: Object;
}
export interface YouTubeConfig {
playerVars?: Object;
preload?: boolean;
}
export interface FacebookConfig {
appId: string;
}
export interface DailyMotionConfig {
params?: Object;
preload?: boolean;
}
export interface VimeoConfig {
iframeParams?: Object;
preload?: boolean;
}
export interface VidmeConfig {
format?: string;
}
export interface WistiaConfig {
options?: Object;
}
export interface FileConfig {
attributes?: Object;
tracks?: TrackProps[];
forceAudio?: boolean;
forceHLS?: boolean;
forceDASH?: boolean;
}
export interface Config {
soundcloud?: SoundCloudConfig;
youtube?: YouTubeConfig;
facebook?: FacebookConfig;
dailymotion?: DailyMotionConfig;
vimeo?: VimeoConfig;
vidme?: VidmeConfig;
file?: FileConfig;
wistia?: WistiaConfig;
}
export interface ReactPlayerProps {
url?: string | string[] | SourceProps[];
playing?: boolean;
loop?: boolean;
controls?: boolean;
volume?: number;
muted?: boolean;
playbackRate?: number;
width?: string | number;
height?: string | number;
style?: Object;
progressFrequency?: number;
playsinline?: boolean;
config?: Config;
soundcloudConfig?: SoundCloudConfig;
youtubeConfig?: YouTubeConfig;
facebookConfig?: FacebookConfig;
dailymotionConfig?: DailyMotionConfig;
vimeoConfig?: VimeoConfig;
vidmeConfig?: VidmeConfig;
fileConfig?: FileConfig;
wistiaConfig?: WistiaConfig;
onReady?(): void;
onStart?(): void;
onPlay?(): void;
onPause?(): void;
onBuffer?(): void;
onEnded?(): void;
onError?(error: any): void;
onDuration?(duration: number): void;
onSeek?(seconds: number): void;
onProgress?(state: { played: number, playedSeconds: number, loaded: number, loadedSeconds: number }): void;
[otherProps: string]: any;
}
export default class ReactPlayer extends React.Component<ReactPlayerProps, any> {
static canPlay(url: string): boolean;
seekTo(fraction: number): void;
getCurrentTime(): number;
getDuration(): number;
getInternalPlayer(key?: string): Object;
}