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