forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
videojs.d.ts
57 lines (51 loc) · 1.64 KB
/
videojs.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
// Type definitions for Video.js
// Project: https://github.com/zencoder/video-js
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// The Video.js API allows you to interact with the video through Javascript, whether the browser is playing the video through HTML5 video, Flash, or any other supported playback technologies.
interface VideoJSOptions {
techOrder?: string[];
html5?: Object;
width?: number;
height?: number;
defaultVolume?: number;
children?: Object;
controls?: boolean;
src?: string;
autoplay?: boolean;
preload?: string;
}
interface VideoJSSource {
type: string;
src: string;
}
interface VideoJSPlayer {
play(): VideoJSPlayer;
pause(): VideoJSPlayer;
paused(): boolean;
src(newSource: string): VideoJSPlayer;
src(newSource: VideoJSSource): VideoJSPlayer;
src(newSource: VideoJSSource[]): VideoJSPlayer;
currentTime(seconds: number): VideoJSPlayer;
currentTime(): number;
duration(): number;
buffered(): TimeRanges;
bufferedPercent(): number;
volume(percentAsDecimal: number): TimeRanges;
volume(): number;
width(): number;
width(pixels: number): VideoJSPlayer;
height(): number;
height(pixels: number): VideoJSPlayer;
size(width: number, height: number): VideoJSPlayer;
requestFullScreen(): VideoJSPlayer;
cancelFullScreen(): VideoJSPlayer;
ready(callback: () => void ): void;
on(eventName: string, callback: () => void ): void;
off(eventName: string, callback: () => void ): void;
dispose(): void;
}
interface VideoJSStatic {
(id: any, options?: VideoJSOptions, ready?: () => void): VideoJSPlayer;
}
declare var videojs:VideoJSStatic;