]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/assets/player/peertube-videojs-typings.ts
Fix signup limit validator, and add warning message.
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-videojs-typings.ts
CommitLineData
f5fcd9f7 1import videojs from 'video.js'
2adfc7ea 2import { PeerTubePlugin } from './peertube-plugin'
09209296
C
3import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin'
4import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin'
5import { PlayerMode } from './peertube-player-manager'
da332417 6import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
d7a25329 7import { VideoFile } from '@shared/models'
c6352f2c 8
f5fcd9f7
C
9declare module 'video.js' {
10 export interface VideoJsPlayer {
11 theaterEnabled: boolean
12
13 // FIXME: add it to upstream typings
14 posterImage: {
15 show (): void
16 hide (): void
17 }
18
19 handleTechSeeked_ (): void
20
21 // Plugins
22
c6352f2c 23 peertube (): PeerTubePlugin
2adfc7ea 24 webtorrent (): WebTorrentPlugin
09209296 25 p2pMediaLoader (): P2pMediaLoaderPlugin
c6352f2c 26
f5fcd9f7
C
27 contextmenuUI (options: any): any
28
29 bezels (): void
30
31 qualityLevels (): { height: number, id: number }[] & {
32 selectedIndex: number
cf57794e 33 selectedIndex_: number
c6352f2c 34
f5fcd9f7
C
35 addQualityLevel (representation: {
36 id: number
37 label: string
cf57794e 38 height: number
f5fcd9f7
C
39 _enabled: boolean
40 }): void
41 }
c6352f2c 42
f5fcd9f7
C
43 textTracks (): TextTrackList & {
44 on: Function
45 tracks_: { kind: string, mode: string, language: string }[]
46 }
47 }
c6352f2c
C
48}
49
16f7022b
C
50type VideoJSCaption = {
51 label: string
52 language: string
53 src: string
54}
55
6e46de09
C
56type UserWatching = {
57 url: string,
58 authorizationHeader: string
59}
60
2adfc7ea 61type PeerTubePluginOptions = {
09209296
C
62 mode: PlayerMode
63
2adfc7ea 64 autoplay: boolean
c6352f2c
C
65 videoViewUrl: string
66 videoDuration: number
6e46de09
C
67
68 userWatching?: UserWatching
2adfc7ea
C
69 subtitle?: string
70
71 videoCaptions: VideoJSCaption[]
f0a39880
C
72
73 stopTime: number | string
2adfc7ea
C
74}
75
76type WebtorrentPluginOptions = {
77 playerElement: HTMLVideoElement
78
79 autoplay: boolean
80 videoDuration: number
81
82 videoFiles: VideoFile[]
f0a39880
C
83
84 startTime: number | string
2adfc7ea
C
85}
86
87type P2PMediaLoaderPluginOptions = {
da332417 88 redundancyUrlManager: RedundancyUrlManager
2adfc7ea
C
89 type: string
90 src: string
f0a39880
C
91
92 startTime: number | string
2adfc7ea
C
93}
94
95type VideoJSPluginOptions = {
96 peertube: PeerTubePluginOptions
97
98 webtorrent?: WebtorrentPluginOptions
99
100 p2pMediaLoader?: P2PMediaLoaderPluginOptions
c6352f2c
C
101}
102
2adfc7ea
C
103type LoadedQualityData = {
104 qualitySwitchCallback: Function,
105 qualityData: {
106 video: {
107 id: number
108 label: string
109 selected: boolean
110 }[]
111 }
112}
113
114type ResolutionUpdateData = {
115 auto: boolean,
116 resolutionId: number
3b6f205c 117 id?: number
2adfc7ea
C
118}
119
120type AutoResolutionUpdateData = {
121 possible: boolean
122}
123
3b6f205c 124type PlayerNetworkInfo = {
09209296
C
125 http: {
126 downloadSpeed: number
127 uploadSpeed: number
128 downloaded: number
129 uploaded: number
130 }
131
3b6f205c
C
132 p2p: {
133 downloadSpeed: number
134 uploadSpeed: number
135 downloaded: number
136 uploaded: number
137 numPeers: number
138 }
139}
140
c6352f2c 141export {
3b6f205c 142 PlayerNetworkInfo,
2adfc7ea
C
143 ResolutionUpdateData,
144 AutoResolutionUpdateData,
6e46de09 145 VideoJSCaption,
2adfc7ea
C
146 UserWatching,
147 PeerTubePluginOptions,
148 WebtorrentPluginOptions,
149 P2PMediaLoaderPluginOptions,
150 VideoJSPluginOptions,
151 LoadedQualityData
c6352f2c 152}