1
0
Fork 0
peertube/client/src/assets/player/peertube-videojs-typings.ts

52 lines
1.0 KiB
TypeScript
Raw Normal View History

const videojs = require('video.js')
import { VideoFile } from '../../../../shared/models/videos/video.model'
import { PeerTubePlugin } from './peertube-videojs-plugin'
2018-06-07 14:50:33 +00:00
declare namespace videojs {
interface Player {
peertube (): PeerTubePlugin
}
}
interface VideoJSComponentInterface {
_player: videojs.Player
new (player: videojs.Player, options?: any): any
registerComponent (name: string, obj: any): any
}
2018-07-13 16:21:19 +00:00
type VideoJSCaption = {
label: string
language: string
src: string
}
2018-10-05 09:15:06 +00:00
type UserWatching = {
url: string,
authorizationHeader: string
}
type PeertubePluginOptions = {
videoFiles: VideoFile[]
playerElement: HTMLVideoElement
videoViewUrl: string
videoDuration: number
startTime: number | string
2018-07-13 16:21:19 +00:00
autoplay: boolean,
videoCaptions: VideoJSCaption[]
2018-10-05 09:15:06 +00:00
userWatching?: UserWatching
}
// videojs typings don't have some method we need
const videojsUntyped = videojs as any
export {
VideoJSComponentInterface,
PeertubePluginOptions,
2018-07-13 16:21:19 +00:00
videojsUntyped,
2018-10-05 09:15:06 +00:00
VideoJSCaption,
UserWatching
}