]>
Commit | Line | Data |
---|---|---|
244b4ae3 | 1 | const videojs = require('video.js') |
c6352f2c C |
2 | import { VideoFile } from '../../../../shared/models/videos/video.model' |
3 | import { PeerTubePlugin } from './peertube-videojs-plugin' | |
4 | ||
6cca7360 | 5 | declare namespace videojs { |
c6352f2c C |
6 | interface Player { |
7 | peertube (): PeerTubePlugin | |
8 | } | |
9 | } | |
10 | ||
11 | interface VideoJSComponentInterface { | |
12 | _player: videojs.Player | |
13 | ||
244b4ae3 | 14 | new (player: videojs.Player, options?: any): any |
c6352f2c | 15 | |
244b4ae3 | 16 | registerComponent (name: string, obj: any): any |
c6352f2c C |
17 | } |
18 | ||
16f7022b C |
19 | type VideoJSCaption = { |
20 | label: string | |
21 | language: string | |
22 | src: string | |
23 | } | |
24 | ||
6e46de09 C |
25 | type UserWatching = { |
26 | url: string, | |
27 | authorizationHeader: string | |
28 | } | |
29 | ||
c6352f2c C |
30 | type PeertubePluginOptions = { |
31 | videoFiles: VideoFile[] | |
32 | playerElement: HTMLVideoElement | |
33 | videoViewUrl: string | |
34 | videoDuration: number | |
1f6824c9 | 35 | startTime: number | string |
16f7022b C |
36 | autoplay: boolean, |
37 | videoCaptions: VideoJSCaption[] | |
6e46de09 C |
38 | |
39 | userWatching?: UserWatching | |
c6352f2c C |
40 | } |
41 | ||
42 | // videojs typings don't have some method we need | |
43 | const videojsUntyped = videojs as any | |
44 | ||
45 | export { | |
46 | VideoJSComponentInterface, | |
47 | PeertubePluginOptions, | |
16f7022b | 48 | videojsUntyped, |
6e46de09 C |
49 | VideoJSCaption, |
50 | UserWatching | |
c6352f2c | 51 | } |