1 import videojs from 'video.js'
2 import { PeerTubePlugin } from './peertube-plugin'
3 import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin'
4 import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin'
5 import { PlayerMode } from './peertube-player-manager'
6 import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
7 import { VideoFile } from '@shared/models'
9 declare module 'video.js' {
10 export interface VideoJsPlayer {
11 theaterEnabled: boolean
13 // FIXME: add it to upstream typings
19 handleTechSeeked_ (): void
23 peertube (): PeerTubePlugin
24 webtorrent (): WebTorrentPlugin
25 p2pMediaLoader (): P2pMediaLoaderPlugin
27 contextmenuUI (options: any): any
31 qualityLevels (): { height: number, id: number }[] & {
33 selectedIndex_: number
35 addQualityLevel (representation: {
43 textTracks (): TextTrackList & {
45 tracks_: { kind: string, mode: string, language: string }[]
50 type VideoJSCaption = {
58 authorizationHeader: string
61 type PeerTubePluginOptions = {
68 userWatching?: UserWatching
71 videoCaptions: VideoJSCaption[]
73 stopTime: number | string
76 type WebtorrentPluginOptions = {
77 playerElement: HTMLVideoElement
82 videoFiles: VideoFile[]
84 startTime: number | string
87 type P2PMediaLoaderPluginOptions = {
88 redundancyUrlManager: RedundancyUrlManager
92 startTime: number | string
95 type VideoJSPluginOptions = {
96 peertube: PeerTubePluginOptions
98 webtorrent?: WebtorrentPluginOptions
100 p2pMediaLoader?: P2PMediaLoaderPluginOptions
103 type LoadedQualityData = {
104 qualitySwitchCallback: Function,
114 type ResolutionUpdateData = {
120 type AutoResolutionUpdateData = {
124 type PlayerNetworkInfo = {
126 downloadSpeed: number
133 downloadSpeed: number
143 ResolutionUpdateData,
144 AutoResolutionUpdateData,
147 PeerTubePluginOptions,
148 WebtorrentPluginOptions,
149 P2PMediaLoaderPluginOptions,
150 VideoJSPluginOptions,