X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-typings.ts;h=634c7fdc9df0e38484c31cebe5ed2b0b1b721c49;hb=3b019808ef529cacce7f40706441670309e231d1;hp=abdf333e11244f4ec5d44f80dc6db4d4421a26ab;hpb=0030284b0df2983914291d6fe83675e2aa892e6a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index abdf333e1..634c7fdc9 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,8 +1,11 @@ +// FIXME: something weird with our path definition in tsconfig and typings +// @ts-ignore import * as videojs from 'video.js' + import { VideoFile } from '../../../../shared/models/videos/video.model' import { PeerTubePlugin } from './peertube-videojs-plugin' -declare module 'video.js' { +declare namespace videojs { interface Player { peertube (): PeerTubePlugin } @@ -11,9 +14,20 @@ declare module 'video.js' { interface VideoJSComponentInterface { _player: videojs.Player - new (player: videojs.Player, options?: any) + new (player: videojs.Player, options?: any): any + + registerComponent (name: string, obj: any): any +} + +type VideoJSCaption = { + label: string + language: string + src: string +} - registerComponent (name: string, obj: any) +type UserWatching = { + url: string, + authorizationHeader: string } type PeertubePluginOptions = { @@ -21,8 +35,12 @@ type PeertubePluginOptions = { playerElement: HTMLVideoElement videoViewUrl: string videoDuration: number - startTime: number - autoplay: boolean + startTime: number | string + autoplay: boolean, + videoCaptions: VideoJSCaption[] + + subtitle?: string + userWatching?: UserWatching } // videojs typings don't have some method we need @@ -31,5 +49,7 @@ const videojsUntyped = videojs as any export { VideoJSComponentInterface, PeertubePluginOptions, - videojsUntyped + videojsUntyped, + VideoJSCaption, + UserWatching }