]>
Commit | Line | Data |
---|---|---|
c6352f2c C |
1 | import * as videojs from 'video.js' |
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 | ||
14 | new (player: videojs.Player, options?: any) | |
15 | ||
16 | registerComponent (name: string, obj: any) | |
17 | } | |
18 | ||
16f7022b C |
19 | type VideoJSCaption = { |
20 | label: string | |
21 | language: string | |
22 | src: string | |
23 | } | |
24 | ||
c6352f2c C |
25 | type PeertubePluginOptions = { |
26 | videoFiles: VideoFile[] | |
27 | playerElement: HTMLVideoElement | |
28 | videoViewUrl: string | |
29 | videoDuration: number | |
1f6824c9 | 30 | startTime: number | string |
16f7022b C |
31 | autoplay: boolean, |
32 | videoCaptions: VideoJSCaption[] | |
c6352f2c C |
33 | } |
34 | ||
35 | // videojs typings don't have some method we need | |
36 | const videojsUntyped = videojs as any | |
37 | ||
38 | export { | |
39 | VideoJSComponentInterface, | |
40 | PeertubePluginOptions, | |
16f7022b C |
41 | videojsUntyped, |
42 | VideoJSCaption | |
c6352f2c | 43 | } |