diff options
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 18 |
1 files changed, 9 insertions, 9 deletions
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 @@ | |||
1 | import { VideoFile } from '../../../../shared/models/videos' | 1 | import { VideoFile } from '../../../../shared/models/videos' |
2 | import videojs, { VideoJsPlayer, VideoJsPlayerOptions } from 'video.js' | 2 | import videojs from 'video.js/dist/alt/video.core.js' |
3 | import 'videojs-hotkeys' | 3 | import 'videojs-hotkeys' |
4 | import 'videojs-dock' | 4 | import 'videojs-dock' |
5 | import 'videojs-contextmenu-ui' | 5 | import 'videojs-contextmenu-ui' |
@@ -99,9 +99,9 @@ export type PeertubePlayerManagerOptions = { | |||
99 | 99 | ||
100 | export class PeertubePlayerManager { | 100 | export 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 | }) |