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