aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-17 11:20:12 +0200
committerChocobozzz <me@florianbigard.com>2020-04-17 14:12:43 +0200
commit7e37e111116e41530749b88327bc601cb39ade03 (patch)
treea141a84b6999029084629d45a3d5addbfa34e603 /client/src
parentbb3933ef370c46be6090e4e522c6e3f5b7144f4c (diff)
downloadPeerTube-7e37e111116e41530749b88327bc601cb39ade03.tar.gz
PeerTube-7e37e111116e41530749b88327bc601cb39ade03.tar.zst
PeerTube-7e37e111116e41530749b88327bc601cb39ade03.zip
Fix videojs typings
Diffstat (limited to 'client/src')
-rw-r--r--client/src/assets/player/bezels/bezels-plugin.ts4
-rw-r--r--client/src/assets/player/bezels/pause-bezel.ts4
-rw-r--r--client/src/assets/player/p2p-media-loader/hls-plugin.ts6
-rw-r--r--client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts4
-rw-r--r--client/src/assets/player/peertube-player-manager.ts18
-rw-r--r--client/src/assets/player/peertube-plugin.ts4
-rw-r--r--client/src/assets/player/peertube-videojs-typings.ts2
-rw-r--r--client/src/assets/player/upnext/end-card.ts4
-rw-r--r--client/src/assets/player/upnext/upnext-plugin.ts4
-rw-r--r--client/src/assets/player/videojs-components/next-video-button.ts4
-rw-r--r--client/src/assets/player/videojs-components/p2p-info-button.ts2
-rw-r--r--client/src/assets/player/videojs-components/peertube-link-button.ts4
-rw-r--r--client/src/assets/player/videojs-components/peertube-load-progress-bar.ts4
-rw-r--r--client/src/assets/player/videojs-components/resolution-menu-button.ts4
-rw-r--r--client/src/assets/player/videojs-components/resolution-menu-item.ts4
-rw-r--r--client/src/assets/player/videojs-components/settings-dialog.ts4
-rw-r--r--client/src/assets/player/videojs-components/settings-menu-button.ts4
-rw-r--r--client/src/assets/player/videojs-components/settings-menu-item.ts4
-rw-r--r--client/src/assets/player/videojs-components/settings-panel-child.ts4
-rw-r--r--client/src/assets/player/videojs-components/settings-panel.ts4
-rw-r--r--client/src/assets/player/videojs-components/theater-button.ts4
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts7
-rw-r--r--client/src/standalone/videos/embed.ts6
23 files changed, 54 insertions, 55 deletions
diff --git a/client/src/assets/player/bezels/bezels-plugin.ts b/client/src/assets/player/bezels/bezels-plugin.ts
index 499177526..ad8bfa703 100644
--- a/client/src/assets/player/bezels/bezels-plugin.ts
+++ b/client/src/assets/player/bezels/bezels-plugin.ts
@@ -1,11 +1,11 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2import './pause-bezel' 2import './pause-bezel'
3 3
4const Plugin = videojs.getPlugin('plugin') 4const Plugin = videojs.getPlugin('plugin')
5 5
6class BezelsPlugin extends Plugin { 6class BezelsPlugin extends Plugin {
7 7
8 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 8 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
9 super(player) 9 super(player)
10 10
11 this.player.ready(() => { 11 this.player.ready(() => {
diff --git a/client/src/assets/player/bezels/pause-bezel.ts b/client/src/assets/player/bezels/pause-bezel.ts
index 98eb12099..d9ef9a390 100644
--- a/client/src/assets/player/bezels/pause-bezel.ts
+++ b/client/src/assets/player/bezels/pause-bezel.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3function getPauseBezel () { 3function getPauseBezel () {
4 return ` 4 return `
@@ -34,7 +34,7 @@ const Component = videojs.getComponent('Component')
34class PauseBezel extends Component { 34class PauseBezel extends Component {
35 container: HTMLDivElement 35 container: HTMLDivElement
36 36
37 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 37 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
38 super(player, options) 38 super(player, options)
39 39
40 player.on('pause', (_: any) => { 40 player.on('pause', (_: any) => {
diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
index 876ed7d9c..6937d147a 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -2,7 +2,7 @@
2// We duplicated this plugin to choose the hls.js version we want, because streamroot only provide a bundled file 2// We duplicated this plugin to choose the hls.js version we want, because streamroot only provide a bundled file
3 3
4import * as Hlsjs from 'hls.js/dist/hls.light.js' 4import * as Hlsjs from 'hls.js/dist/hls.light.js'
5import videojs, { VideoJsPlayer } from 'video.js' 5import videojs from 'video.js/dist/alt/video.core.js'
6import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings' 6import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings'
7 7
8type ErrorCounts = { 8type ErrorCounts = {
@@ -55,7 +55,7 @@ const registerSourceHandler = function (vjs: typeof videojs) {
55 (vjs as any).Html5Hlsjs = Html5Hlsjs 55 (vjs as any).Html5Hlsjs = Html5Hlsjs
56} 56}
57 57
58function hlsjsConfigHandler (this: VideoJsPlayer, options: HlsjsConfigHandlerOptions) { 58function hlsjsConfigHandler (this: videojs.Player, options: HlsjsConfigHandlerOptions) {
59 const player = this 59 const player = this
60 60
61 if (!options) return 61 if (!options) return
@@ -88,7 +88,7 @@ class Html5Hlsjs {
88 88
89 private readonly videoElement: HTMLVideoElement 89 private readonly videoElement: HTMLVideoElement
90 private readonly errorCounts: ErrorCounts = {} 90 private readonly errorCounts: ErrorCounts = {}
91 private readonly player: VideoJsPlayer 91 private readonly player: videojs.Player
92 private readonly tech: videojs.Tech 92 private readonly tech: videojs.Tech
93 private readonly source: videojs.Tech.SourceObject 93 private readonly source: videojs.Tech.SourceObject
94 private readonly vjs: typeof videojs 94 private readonly vjs: typeof videojs
diff --git a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
index ca205d899..161c92b5e 100644
--- a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2import { P2PMediaLoaderPluginOptions, PlayerNetworkInfo } from '../peertube-videojs-typings' 2import { P2PMediaLoaderPluginOptions, PlayerNetworkInfo } from '../peertube-videojs-typings'
3import { Engine, initHlsJsPlayer, initVideoJsContribHlsJsPlayer } from 'p2p-media-loader-hlsjs' 3import { Engine, initHlsJsPlayer, initVideoJsContribHlsJsPlayer } from 'p2p-media-loader-hlsjs'
4import { Events, Segment } from 'p2p-media-loader-core' 4import { Events, Segment } from 'p2p-media-loader-core'
@@ -36,7 +36,7 @@ class P2pMediaLoaderPlugin extends Plugin {
36 36
37 private networkInfoInterval: any 37 private networkInfoInterval: any
38 38
39 constructor (player: VideoJsPlayer, options?: P2PMediaLoaderPluginOptions) { 39 constructor (player: videojs.Player, options?: P2PMediaLoaderPluginOptions) {
40 super(player) 40 super(player)
41 41
42 this.options = options 42 this.options = options
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 6d9236a9d..50701eefe 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -1,5 +1,5 @@
1import { VideoFile } from '../../../../shared/models/videos' 1import { VideoFile } from '../../../../shared/models/videos'
2import videojs, { VideoJsPlayer, VideoJsPlayerOptions } from 'video.js' 2import videojs from 'video.js/dist/alt/video.core.js'
3import 'videojs-hotkeys' 3import 'videojs-hotkeys'
4import 'videojs-dock' 4import 'videojs-dock'
5import 'videojs-contextmenu-ui' 5import 'videojs-contextmenu-ui'
@@ -99,9 +99,9 @@ export type PeertubePlayerManagerOptions = {
99 99
100export class PeertubePlayerManager { 100export class PeertubePlayerManager {
101 private static playerElementClassName: string 101 private static playerElementClassName: string
102 private static onPlayerChange: (player: VideoJsPlayer) => void 102 private static onPlayerChange: (player: videojs.Player) => void
103 103
104 static async initialize (mode: PlayerMode, options: PeertubePlayerManagerOptions, onPlayerChange: (player: VideoJsPlayer) => void) { 104 static async initialize (mode: PlayerMode, options: PeertubePlayerManagerOptions, onPlayerChange: (player: videojs.Player) => void) {
105 let p2pMediaLoader: any 105 let p2pMediaLoader: any
106 106
107 this.onPlayerChange = onPlayerChange 107 this.onPlayerChange = onPlayerChange
@@ -121,7 +121,7 @@ export class PeertubePlayerManager {
121 121
122 const self = this 122 const self = this
123 return new Promise(res => { 123 return new Promise(res => {
124 videojs(options.common.playerElement, videojsOptions, function (this: VideoJsPlayer) { 124 videojs(options.common.playerElement, videojsOptions, function (this: videojs.Player) {
125 const player = this 125 const player = this
126 126
127 let alreadyFallback = false 127 let alreadyFallback = false
@@ -171,7 +171,7 @@ export class PeertubePlayerManager {
171 const videojsOptions = this.getVideojsOptions(mode, options) 171 const videojsOptions = this.getVideojsOptions(mode, options)
172 172
173 const self = this 173 const self = this
174 videojs(newVideoElement, videojsOptions, function (this: VideoJsPlayer) { 174 videojs(newVideoElement, videojsOptions, function (this: videojs.Player) {
175 const player = this 175 const player = this
176 176
177 self.addContextMenu(mode, player, options.common.embedUrl) 177 self.addContextMenu(mode, player, options.common.embedUrl)
@@ -184,7 +184,7 @@ export class PeertubePlayerManager {
184 mode: PlayerMode, 184 mode: PlayerMode,
185 options: PeertubePlayerManagerOptions, 185 options: PeertubePlayerManagerOptions,
186 p2pMediaLoaderModule?: any 186 p2pMediaLoaderModule?: any
187 ): VideoJsPlayerOptions { 187 ): videojs.PlayerOptions {
188 const commonOptions = options.common 188 const commonOptions = options.common
189 189
190 let autoplay = commonOptions.autoplay 190 let autoplay = commonOptions.autoplay
@@ -417,7 +417,7 @@ export class PeertubePlayerManager {
417 return children 417 return children
418 } 418 }
419 419
420 private static addContextMenu (mode: PlayerMode, player: VideoJsPlayer, videoEmbedUrl: string) { 420 private static addContextMenu (mode: PlayerMode, player: videojs.Player, videoEmbedUrl: string) {
421 const content = [ 421 const content = [
422 { 422 {
423 label: player.localize('Copy the video URL'), 423 label: player.localize('Copy the video URL'),
@@ -427,7 +427,7 @@ export class PeertubePlayerManager {
427 }, 427 },
428 { 428 {
429 label: player.localize('Copy the video URL at the current time'), 429 label: player.localize('Copy the video URL at the current time'),
430 listener: function (this: VideoJsPlayer) { 430 listener: function (this: videojs.Player) {
431 copyToClipboard(buildVideoLink({ startTime: this.currentTime() })) 431 copyToClipboard(buildVideoLink({ startTime: this.currentTime() }))
432 } 432 }
433 }, 433 },
@@ -442,7 +442,7 @@ export class PeertubePlayerManager {
442 if (mode === 'webtorrent') { 442 if (mode === 'webtorrent') {
443 content.push({ 443 content.push({
444 label: player.localize('Copy magnet URI'), 444 label: player.localize('Copy magnet URI'),
445 listener: function (this: VideoJsPlayer) { 445 listener: function (this: videojs.Player) {
446 copyToClipboard(this.webtorrent().getCurrentVideoFile().magnetUri) 446 copyToClipboard(this.webtorrent().getCurrentVideoFile().magnetUri)
447 } 447 }
448 }) 448 })
diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts
index 19d104676..afd8d678b 100644
--- a/client/src/assets/player/peertube-plugin.ts
+++ b/client/src/assets/player/peertube-plugin.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core'
2import './videojs-components/settings-menu-button' 2import './videojs-components/settings-menu-button'
3import { 3import {
4 PeerTubePluginOptions, 4 PeerTubePluginOptions,
@@ -36,7 +36,7 @@ class PeerTubePlugin extends Plugin {
36 private mouseInControlBar = false 36 private mouseInControlBar = false
37 private readonly savedInactivityTimeout: number 37 private readonly savedInactivityTimeout: number
38 38
39 constructor (player: VideoJsPlayer, options?: PeerTubePluginOptions) { 39 constructor (player: videojs.Player, options?: PeerTubePluginOptions) {
40 super(player) 40 super(player)
41 41
42 this.videoViewUrl = options.videoViewUrl 42 this.videoViewUrl = options.videoViewUrl
diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts
index a4e4c580c..9616dd326 100644
--- a/client/src/assets/player/peertube-videojs-typings.ts
+++ b/client/src/assets/player/peertube-videojs-typings.ts
@@ -4,7 +4,7 @@ import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin
4import { PlayerMode } from './peertube-player-manager' 4import { PlayerMode } from './peertube-player-manager'
5import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' 5import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
6import { VideoFile } from '@shared/models' 6import { VideoFile } from '@shared/models'
7import videojs from 'video.js' 7import videojs from 'video.js/dist/alt/video.core.js'
8import { Config, Level } from 'hls.js' 8import { Config, Level } from 'hls.js'
9 9
10declare module 'video.js' { 10declare module 'video.js' {
diff --git a/client/src/assets/player/upnext/end-card.ts b/client/src/assets/player/upnext/end-card.ts
index d121a83a9..c39a9c913 100644
--- a/client/src/assets/player/upnext/end-card.ts
+++ b/client/src/assets/player/upnext/end-card.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3function getMainTemplate (options: any) { 3function getMainTemplate (options: any) {
4 return ` 4 return `
@@ -50,7 +50,7 @@ class EndCard extends Component {
50 suspendedMessage: HTMLElement 50 suspendedMessage: HTMLElement
51 nextButton: HTMLElement 51 nextButton: HTMLElement
52 52
53 constructor (player: VideoJsPlayer, options: EndCardOptions) { 53 constructor (player: videojs.Player, options: EndCardOptions) {
54 super(player, options) 54 super(player, options)
55 55
56 this.totalTicks = this.options_.timeout / this.interval 56 this.totalTicks = this.options_.timeout / this.interval
diff --git a/client/src/assets/player/upnext/upnext-plugin.ts b/client/src/assets/player/upnext/upnext-plugin.ts
index 6512fec2c..ac7699e9a 100644
--- a/client/src/assets/player/upnext/upnext-plugin.ts
+++ b/client/src/assets/player/upnext/upnext-plugin.ts
@@ -1,11 +1,11 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2import { EndCardOptions } from './end-card' 2import { EndCardOptions } from './end-card'
3 3
4const Plugin = videojs.getPlugin('plugin') 4const Plugin = videojs.getPlugin('plugin')
5 5
6class UpNextPlugin extends Plugin { 6class UpNextPlugin extends Plugin {
7 7
8 constructor (player: VideoJsPlayer, options: Partial<EndCardOptions> = {}) { 8 constructor (player: videojs.Player, options: Partial<EndCardOptions> = {}) {
9 const settings = { 9 const settings = {
10 next: options.next, 10 next: options.next,
11 getTitle: options.getTitle, 11 getTitle: options.getTitle,
diff --git a/client/src/assets/player/videojs-components/next-video-button.ts b/client/src/assets/player/videojs-components/next-video-button.ts
index bdb245dcc..c97ecdda6 100644
--- a/client/src/assets/player/videojs-components/next-video-button.ts
+++ b/client/src/assets/player/videojs-components/next-video-button.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3const Button = videojs.getComponent('Button') 3const Button = videojs.getComponent('Button')
4 4
@@ -9,7 +9,7 @@ export interface NextVideoButtonOptions extends videojs.ComponentOptions {
9class NextVideoButton extends Button { 9class NextVideoButton extends Button {
10 private readonly nextVideoButtonOptions: NextVideoButtonOptions 10 private readonly nextVideoButtonOptions: NextVideoButtonOptions
11 11
12 constructor (player: VideoJsPlayer, options?: NextVideoButtonOptions) { 12 constructor (player: videojs.Player, options?: NextVideoButtonOptions) {
13 super(player, options) 13 super(player, options)
14 14
15 this.nextVideoButtonOptions = options 15 this.nextVideoButtonOptions = options
diff --git a/client/src/assets/player/videojs-components/p2p-info-button.ts b/client/src/assets/player/videojs-components/p2p-info-button.ts
index db6806fed..e340337ed 100644
--- a/client/src/assets/player/videojs-components/p2p-info-button.ts
+++ b/client/src/assets/player/videojs-components/p2p-info-button.ts
@@ -1,5 +1,5 @@
1import { PlayerNetworkInfo } from '../peertube-videojs-typings' 1import { PlayerNetworkInfo } from '../peertube-videojs-typings'
2import videojs from 'video.js' 2import videojs from 'video.js/dist/alt/video.core.js'
3import { bytes } from '../utils' 3import { bytes } from '../utils'
4 4
5const Button = videojs.getComponent('Button') 5const Button = videojs.getComponent('Button')
diff --git a/client/src/assets/player/videojs-components/peertube-link-button.ts b/client/src/assets/player/videojs-components/peertube-link-button.ts
index 0db9762a5..4151758d4 100644
--- a/client/src/assets/player/videojs-components/peertube-link-button.ts
+++ b/client/src/assets/player/videojs-components/peertube-link-button.ts
@@ -1,10 +1,10 @@
1import { buildVideoLink } from '../utils' 1import { buildVideoLink } from '../utils'
2import videojs, { VideoJsPlayer } from 'video.js' 2import videojs from 'video.js/dist/alt/video.core.js'
3 3
4const Button = videojs.getComponent('Button') 4const Button = videojs.getComponent('Button')
5class PeerTubeLinkButton extends Button { 5class PeerTubeLinkButton extends Button {
6 6
7 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 7 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
8 super(player, options) 8 super(player, options)
9 } 9 }
10 10
diff --git a/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts b/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts
index 8168e8f2d..395720c53 100644
--- a/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts
+++ b/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts
@@ -1,10 +1,10 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3const Component = videojs.getComponent('Component') 3const Component = videojs.getComponent('Component')
4 4
5class PeerTubeLoadProgressBar extends Component { 5class PeerTubeLoadProgressBar extends Component {
6 6
7 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 7 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
8 super(player, options) 8 super(player, options)
9 9
10 this.on(player, 'progress', this.update) 10 this.on(player, 'progress', this.update)
diff --git a/client/src/assets/player/videojs-components/resolution-menu-button.ts b/client/src/assets/player/videojs-components/resolution-menu-button.ts
index 0fa6272e7..d49ca0230 100644
--- a/client/src/assets/player/videojs-components/resolution-menu-button.ts
+++ b/client/src/assets/player/videojs-components/resolution-menu-button.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3import { LoadedQualityData } from '../peertube-videojs-typings' 3import { LoadedQualityData } from '../peertube-videojs-typings'
4import { ResolutionMenuItem } from './resolution-menu-item' 4import { ResolutionMenuItem } from './resolution-menu-item'
@@ -8,7 +8,7 @@ const MenuButton = videojs.getComponent('MenuButton')
8class ResolutionMenuButton extends MenuButton { 8class ResolutionMenuButton extends MenuButton {
9 labelEl_: HTMLElement 9 labelEl_: HTMLElement
10 10
11 constructor (player: VideoJsPlayer, options?: videojs.MenuButtonOptions) { 11 constructor (player: videojs.Player, options?: videojs.MenuButtonOptions) {
12 super(player, options) 12 super(player, options)
13 13
14 this.controlText('Quality') 14 this.controlText('Quality')
diff --git a/client/src/assets/player/videojs-components/resolution-menu-item.ts b/client/src/assets/player/videojs-components/resolution-menu-item.ts
index b039c4572..cb0d219ad 100644
--- a/client/src/assets/player/videojs-components/resolution-menu-item.ts
+++ b/client/src/assets/player/videojs-components/resolution-menu-item.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2import { AutoResolutionUpdateData, ResolutionUpdateData } from '../peertube-videojs-typings' 2import { AutoResolutionUpdateData, ResolutionUpdateData } from '../peertube-videojs-typings'
3 3
4const MenuItem = videojs.getComponent('MenuItem') 4const MenuItem = videojs.getComponent('MenuItem')
@@ -19,7 +19,7 @@ class ResolutionMenuItem extends MenuItem {
19 private autoResolutionPossible: boolean 19 private autoResolutionPossible: boolean
20 private currentResolutionLabel: string 20 private currentResolutionLabel: string
21 21
22 constructor (player: VideoJsPlayer, options?: ResolutionMenuItemOptions) { 22 constructor (player: videojs.Player, options?: ResolutionMenuItemOptions) {
23 options.selectable = true 23 options.selectable = true
24 24
25 super(player, options) 25 super(player, options)
diff --git a/client/src/assets/player/videojs-components/settings-dialog.ts b/client/src/assets/player/videojs-components/settings-dialog.ts
index dd0b1e472..8fd5ad96c 100644
--- a/client/src/assets/player/videojs-components/settings-dialog.ts
+++ b/client/src/assets/player/videojs-components/settings-dialog.ts
@@ -1,9 +1,9 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3const Component = videojs.getComponent('Component') 3const Component = videojs.getComponent('Component')
4 4
5class SettingsDialog extends Component { 5class SettingsDialog extends Component {
6 constructor (player: VideoJsPlayer) { 6 constructor (player: videojs.Player) {
7 super(player) 7 super(player)
8 8
9 this.hide() 9 this.hide()
diff --git a/client/src/assets/player/videojs-components/settings-menu-button.ts b/client/src/assets/player/videojs-components/settings-menu-button.ts
index eae628e7d..749128bdc 100644
--- a/client/src/assets/player/videojs-components/settings-menu-button.ts
+++ b/client/src/assets/player/videojs-components/settings-menu-button.ts
@@ -1,7 +1,7 @@
1// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu 1// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu
2import { SettingsMenuItem } from './settings-menu-item' 2import { SettingsMenuItem } from './settings-menu-item'
3import { toTitleCase } from '../utils' 3import { toTitleCase } from '../utils'
4import videojs, { VideoJsPlayer } from 'video.js' 4import videojs from 'video.js/dist/alt/video.core.js'
5 5
6import { SettingsDialog } from './settings-dialog' 6import { SettingsDialog } from './settings-dialog'
7import { SettingsPanel } from './settings-panel' 7import { SettingsPanel } from './settings-panel'
@@ -32,7 +32,7 @@ class SettingsButton extends Button {
32 32
33 private settingsButtonOptions: SettingsButtonOptions 33 private settingsButtonOptions: SettingsButtonOptions
34 34
35 constructor (player: VideoJsPlayer, options?: SettingsButtonOptions) { 35 constructor (player: videojs.Player, options?: SettingsButtonOptions) {
36 super(player, options) 36 super(player, options)
37 37
38 this.settingsButtonOptions = options 38 this.settingsButtonOptions = options
diff --git a/client/src/assets/player/videojs-components/settings-menu-item.ts b/client/src/assets/player/videojs-components/settings-menu-item.ts
index f5671f49d..8d364591b 100644
--- a/client/src/assets/player/videojs-components/settings-menu-item.ts
+++ b/client/src/assets/player/videojs-components/settings-menu-item.ts
@@ -1,6 +1,6 @@
1// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu 1// Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu
2import { toTitleCase } from '../utils' 2import { toTitleCase } from '../utils'
3import videojs, { VideoJsPlayer } from 'video.js' 3import videojs from 'video.js/dist/alt/video.core.js'
4import { SettingsButton } from './settings-menu-button' 4import { SettingsButton } from './settings-menu-button'
5import { SettingsDialog } from './settings-dialog' 5import { SettingsDialog } from './settings-dialog'
6import { SettingsPanel } from './settings-panel' 6import { SettingsPanel } from './settings-panel'
@@ -32,7 +32,7 @@ class SettingsMenuItem extends MenuItem {
32 settingsSubMenuValueEl_: HTMLElement 32 settingsSubMenuValueEl_: HTMLElement
33 settingsSubMenuEl_: HTMLElement 33 settingsSubMenuEl_: HTMLElement
34 34
35 constructor (player: VideoJsPlayer, options?: SettingsMenuItemOptions) { 35 constructor (player: videojs.Player, options?: SettingsMenuItemOptions) {
36 super(player, options) 36 super(player, options)
37 37
38 this.settingsButton = options.menuButton 38 this.settingsButton = options.menuButton
diff --git a/client/src/assets/player/videojs-components/settings-panel-child.ts b/client/src/assets/player/videojs-components/settings-panel-child.ts
index d12e8218a..6dee6d7df 100644
--- a/client/src/assets/player/videojs-components/settings-panel-child.ts
+++ b/client/src/assets/player/videojs-components/settings-panel-child.ts
@@ -1,10 +1,10 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3const Component = videojs.getComponent('Component') 3const Component = videojs.getComponent('Component')
4 4
5class SettingsPanelChild extends Component { 5class SettingsPanelChild extends Component {
6 6
7 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 7 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
8 super(player, options) 8 super(player, options)
9 } 9 }
10 10
diff --git a/client/src/assets/player/videojs-components/settings-panel.ts b/client/src/assets/player/videojs-components/settings-panel.ts
index 2090abf45..833ee2f21 100644
--- a/client/src/assets/player/videojs-components/settings-panel.ts
+++ b/client/src/assets/player/videojs-components/settings-panel.ts
@@ -1,10 +1,10 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2 2
3const Component = videojs.getComponent('Component') 3const Component = videojs.getComponent('Component')
4 4
5class SettingsPanel extends Component { 5class SettingsPanel extends Component {
6 6
7 constructor (player: VideoJsPlayer, options?: videojs.ComponentOptions) { 7 constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
8 super(player, options) 8 super(player, options)
9 } 9 }
10 10
diff --git a/client/src/assets/player/videojs-components/theater-button.ts b/client/src/assets/player/videojs-components/theater-button.ts
index 1c8c9f154..41875af71 100644
--- a/client/src/assets/player/videojs-components/theater-button.ts
+++ b/client/src/assets/player/videojs-components/theater-button.ts
@@ -1,4 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2import { saveTheaterInStore, getStoredTheater } from '../peertube-player-local-storage' 2import { saveTheaterInStore, getStoredTheater } from '../peertube-player-local-storage'
3 3
4const Button = videojs.getComponent('Button') 4const Button = videojs.getComponent('Button')
@@ -6,7 +6,7 @@ class TheaterButton extends Button {
6 6
7 private static readonly THEATER_MODE_CLASS = 'vjs-theater-enabled' 7 private static readonly THEATER_MODE_CLASS = 'vjs-theater-enabled'
8 8
9 constructor (player: VideoJsPlayer, options: videojs.ComponentOptions) { 9 constructor (player: videojs.Player, options: videojs.ComponentOptions) {
10 super(player, options) 10 super(player, options)
11 11
12 const enabled = getStoredTheater() 12 const enabled = getStoredTheater()
diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
index bf6b0a718..26fb5a245 100644
--- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
@@ -1,5 +1,4 @@
1import videojs, { VideoJsPlayer } from 'video.js' 1import videojs from 'video.js/dist/alt/video.core.js'
2
3import * as WebTorrent from 'webtorrent' 2import * as WebTorrent from 'webtorrent'
4import { renderVideo } from './video-renderer' 3import { renderVideo } from './video-renderer'
5import { LoadedQualityData, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' 4import { LoadedQualityData, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings'
@@ -31,7 +30,7 @@ class WebTorrentPlugin extends Plugin {
31 30
32 private readonly autoplay: boolean = false 31 private readonly autoplay: boolean = false
33 private readonly startTime: number = 0 32 private readonly startTime: number = 0
34 private readonly savePlayerSrcFunction: VideoJsPlayer['src'] 33 private readonly savePlayerSrcFunction: videojs.Player['src']
35 private readonly videoDuration: number 34 private readonly videoDuration: number
36 private readonly CONSTANTS = { 35 private readonly CONSTANTS = {
37 INFO_SCHEDULER: 1000, // Don't change this 36 INFO_SCHEDULER: 1000, // Don't change this
@@ -69,7 +68,7 @@ class WebTorrentPlugin extends Plugin {
69 68
70 private downloadSpeeds: number[] = [] 69 private downloadSpeeds: number[] = []
71 70
72 constructor (player: VideoJsPlayer, options?: WebtorrentPluginOptions) { 71 constructor (player: videojs.Player, options?: WebtorrentPluginOptions) {
73 super(player) 72 super(player)
74 73
75 this.startTime = timeToInt(options.startTime) 74 this.startTime = timeToInt(options.startTime)
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 879850daf..6616fab48 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -15,14 +15,14 @@ import {
15import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' 15import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type'
16import { PeerTubeEmbedApi } from './embed-api' 16import { PeerTubeEmbedApi } from './embed-api'
17import { TranslationsManager } from '../../assets/player/translations-manager' 17import { TranslationsManager } from '../../assets/player/translations-manager'
18import { VideoJsPlayer } from 'video.js' 18import videojs from 'video.js/dist/alt/video.core.js'
19import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings' 19import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings'
20 20
21type Translations = { [ id: string ]: string } 21type Translations = { [ id: string ]: string }
22 22
23export class PeerTubeEmbed { 23export class PeerTubeEmbed {
24 videoElement: HTMLVideoElement 24 videoElement: HTMLVideoElement
25 player: VideoJsPlayer 25 player: videojs.Player
26 api: PeerTubeEmbedApi = null 26 api: PeerTubeEmbedApi = null
27 autoplay: boolean 27 autoplay: boolean
28 controls: boolean 28 controls: boolean
@@ -237,7 +237,7 @@ export class PeerTubeEmbed {
237 }) 237 })
238 } 238 }
239 239
240 this.player = await PeertubePlayerManager.initialize(this.mode, options, (player: VideoJsPlayer) => this.player = player) 240 this.player = await PeertubePlayerManager.initialize(this.mode, options, (player: videojs.Player) => this.player = player)
241 this.player.on('customError', (event: any, data: any) => this.handleError(data.err, serverTranslations)) 241 this.player.on('customError', (event: any, data: any) => this.handleError(data.err, serverTranslations))
242 242
243 window[ 'videojsPlayer' ] = this.player 243 window[ 'videojsPlayer' ] = this.player