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