-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathbase.d.ts
78 lines (74 loc) · 1.9 KB
/
base.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
import {
Component,
ReactElement,
CSSProperties,
ComponentType,
ReactNode
} from 'react'
import ReactPlayer from './lib'
interface SourceProps {
media?: string
src: string
type?: string
}
export interface OnProgressProps {
played: number
playedSeconds: number
loaded: number
loadedSeconds: number
}
export interface BaseReactPlayerProps {
url?: string | string[] | SourceProps[] | MediaStream
playing?: boolean
loop?: boolean
controls?: boolean
volume?: number
muted?: boolean
playbackRate?: number
width?: string | number
height?: string | number
style?: CSSProperties
progressInterval?: number
playsinline?: boolean
playIcon?: ReactElement
previewTabIndex?: number | null
pip?: boolean
stopOnUnmount?: boolean
light?: boolean | string | ReactElement
fallback?: ReactElement
wrapper?: ComponentType<{ children: ReactNode }>
onReady?: (player: ReactPlayer) => void
onStart?: () => void
onPlay?: () => void
onPause?: () => void
onBuffer?: () => void
onBufferEnd?: () => void
onEnded?: () => void
onClickPreview?: (event: any) => void
onEnablePIP?: () => void
onDisablePIP?: () => void
onError?: (
error: any,
data?: any,
hlsInstance?: any,
hlsGlobal?: any
) => void
onDuration?: (duration: number) => void
onSeek?: (seconds: number) => void
onProgress?: (state: OnProgressProps) => void
[otherProps: string]: any
}
export default class BaseReactPlayer<
T extends BaseReactPlayerProps
> extends Component<T, any> {
static canPlay (url: string): boolean;
static canEnablePIP (url: string): boolean;
static addCustomPlayer (player: ReactPlayer): void;
static removeCustomPlayers (): void;
seekTo (amount: number, type?: 'seconds' | 'fraction'): void;
getCurrentTime (): number;
getSecondsLoaded (): number;
getDuration (): number;
getInternalPlayer (key?: string): Record<string, any>;
showPreview (): void;
}