]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - 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
c199c427
C
1// FIXME: something weird with our path definition in tsconfig and typings
2// @ts-ignore
3import * as videojs from 'video.js'
4
c6352f2c
C
5import { VideoFile } from '../../../../shared/models/videos/video.model'
6import { PeerTubePlugin } from './peertube-videojs-plugin'
7
6cca7360 8declare namespace videojs {
c6352f2c
C
9 interface Player {
10 peertube (): PeerTubePlugin
11 }
12}
13
14interface 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
22type VideoJSCaption = {
23 label: string
24 language: string
25 src: string
26}
27
6e46de09
C
28type UserWatching = {
29 url: string,
30 authorizationHeader: string
31}
32
c6352f2c
C
33type 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
47const videojsUntyped = videojs as any
48
49export {
50 VideoJSComponentInterface,
51 PeertubePluginOptions,
16f7022b 52 videojsUntyped,
6e46de09
C
53 VideoJSCaption,
54 UserWatching
c6352f2c 55}