From 7e37e111116e41530749b88327bc601cb39ade03 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Apr 2020 11:20:12 +0200 Subject: Fix videojs typings --- client/src/assets/player/p2p-media-loader/hls-plugin.ts | 6 +++--- .../src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/assets/player/p2p-media-loader') 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 @@ // We duplicated this plugin to choose the hls.js version we want, because streamroot only provide a bundled file import * as Hlsjs from 'hls.js/dist/hls.light.js' -import videojs, { VideoJsPlayer } from 'video.js' +import videojs from 'video.js/dist/alt/video.core.js' import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings' type ErrorCounts = { @@ -55,7 +55,7 @@ const registerSourceHandler = function (vjs: typeof videojs) { (vjs as any).Html5Hlsjs = Html5Hlsjs } -function hlsjsConfigHandler (this: VideoJsPlayer, options: HlsjsConfigHandlerOptions) { +function hlsjsConfigHandler (this: videojs.Player, options: HlsjsConfigHandlerOptions) { const player = this if (!options) return @@ -88,7 +88,7 @@ class Html5Hlsjs { private readonly videoElement: HTMLVideoElement private readonly errorCounts: ErrorCounts = {} - private readonly player: VideoJsPlayer + private readonly player: videojs.Player private readonly tech: videojs.Tech private readonly source: videojs.Tech.SourceObject 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 @@ -import videojs, { VideoJsPlayer } from 'video.js' +import videojs from 'video.js/dist/alt/video.core.js' import { P2PMediaLoaderPluginOptions, PlayerNetworkInfo } from '../peertube-videojs-typings' import { Engine, initHlsJsPlayer, initVideoJsContribHlsJsPlayer } from 'p2p-media-loader-hlsjs' import { Events, Segment } from 'p2p-media-loader-core' @@ -36,7 +36,7 @@ class P2pMediaLoaderPlugin extends Plugin { private networkInfoInterval: any - constructor (player: VideoJsPlayer, options?: P2PMediaLoaderPluginOptions) { + constructor (player: videojs.Player, options?: P2PMediaLoaderPluginOptions) { super(player) this.options = options -- cgit v1.2.3