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