PeerTube/client/src/assets/player/peertube-videojs-typings.ts

44 lines
907 B
TypeScript
Raw Normal View History

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