]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-videojs-typings.ts
Merge branch 'release/v1.2.0'
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-videojs-typings.ts
index 9c029923772beb0452778e80e99bce681bbbe7c4..634c7fdc9df0e38484c31cebe5ed2b0b1b721c49 100644 (file)
@@ -1,4 +1,7 @@
+// 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'
 
@@ -11,9 +14,9 @@ declare namespace videojs {
 interface VideoJSComponentInterface {
   _player: videojs.Player
 
-  new (player: videojs.Player, options?: any)
+  new (player: videojs.Player, options?: any): any
 
-  registerComponent (name: string, obj: any)
+  registerComponent (name: string, obj: any): any
 }
 
 type VideoJSCaption = {
@@ -22,14 +25,22 @@ type VideoJSCaption = {
   src: string
 }
 
+type UserWatching = {
+  url: string,
+  authorizationHeader: string
+}
+
 type PeertubePluginOptions = {
   videoFiles: VideoFile[]
   playerElement: HTMLVideoElement
   videoViewUrl: string
   videoDuration: number
-  startTime: number
+  startTime: number | string
   autoplay: boolean,
   videoCaptions: VideoJSCaption[]
+
+  subtitle?: string
+  userWatching?: UserWatching
 }
 
 // videojs typings don't have some method we need
@@ -39,5 +50,6 @@ export {
   VideoJSComponentInterface,
   PeertubePluginOptions,
   videojsUntyped,
-  VideoJSCaption
+  VideoJSCaption,
+  UserWatching
 }