From: Chocobozzz Date: Tue, 21 Apr 2020 09:02:28 +0000 (+0200) Subject: Fix videojs X-Git-Tag: v2.2.0-rc.1~167 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=512decf37ee6d36d0f16bda0f9bec6bf37d132b3;p=oweals%2Fpeertube.git Fix videojs --- diff --git a/client/src/assets/player/bezels/bezels-plugin.ts b/client/src/assets/player/bezels/bezels-plugin.ts index ad8bfa703..ca88bc1f9 100644 --- a/client/src/assets/player/bezels/bezels-plugin.ts +++ b/client/src/assets/player/bezels/bezels-plugin.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import './pause-bezel' const Plugin = videojs.getPlugin('plugin') diff --git a/client/src/assets/player/bezels/pause-bezel.ts b/client/src/assets/player/bezels/pause-bezel.ts index d9ef9a390..886574380 100644 --- a/client/src/assets/player/bezels/pause-bezel.ts +++ b/client/src/assets/player/bezels/pause-bezel.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' function getPauseBezel () { return ` 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 6937d147a..9e2ac1aa4 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 from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { HlsjsConfigHandlerOptions, QualityLevelRepresentation, QualityLevels, VideoJSTechHLS } from '../peertube-videojs-typings' type ErrorCounts = { 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 161c92b5e..46c6bbaf2 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 from 'video.js/dist/alt/video.core.js' +import videojs from 'video.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' diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 50701eefe..12e460f03 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts @@ -1,6 +1,6 @@ import { VideoFile } from '../../../../shared/models/videos' -import videojs from 'video.js/dist/alt/video.core.js' -import 'videojs-hotkeys' +import videojs from 'video.js' +import 'videojs-hotkeys/videojs.hotkeys' import 'videojs-dock' import 'videojs-contextmenu-ui' import 'videojs-contrib-quality-levels' diff --git a/client/src/assets/player/peertube-plugin.ts b/client/src/assets/player/peertube-plugin.ts index afd8d678b..5085f7f86 100644 --- a/client/src/assets/player/peertube-plugin.ts +++ b/client/src/assets/player/peertube-plugin.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core' +import videojs from 'video.js' import './videojs-components/settings-menu-button' import { PeerTubePluginOptions, diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index 9616dd326..a4e4c580c 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 import { PlayerMode } from './peertube-player-manager' import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' import { VideoFile } from '@shared/models' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { Config, Level } from 'hls.js' declare module 'video.js' { diff --git a/client/src/assets/player/upnext/end-card.ts b/client/src/assets/player/upnext/end-card.ts index c39a9c913..8fabfc3fd 100644 --- a/client/src/assets/player/upnext/end-card.ts +++ b/client/src/assets/player/upnext/end-card.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' function getMainTemplate (options: any) { return ` diff --git a/client/src/assets/player/upnext/upnext-plugin.ts b/client/src/assets/player/upnext/upnext-plugin.ts index ac7699e9a..db969024d 100644 --- a/client/src/assets/player/upnext/upnext-plugin.ts +++ b/client/src/assets/player/upnext/upnext-plugin.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { EndCardOptions } from './end-card' const Plugin = videojs.getPlugin('plugin') 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 c97ecdda6..22b32f06b 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 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Button = videojs.getComponent('Button') 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 e340337ed..db6806fed 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 @@ import { PlayerNetworkInfo } from '../peertube-videojs-typings' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { bytes } from '../utils' const 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 4151758d4..63e92eb77 100644 --- a/client/src/assets/player/videojs-components/peertube-link-button.ts +++ b/client/src/assets/player/videojs-components/peertube-link-button.ts @@ -1,5 +1,5 @@ import { buildVideoLink } from '../utils' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Button = videojs.getComponent('Button') class PeerTubeLinkButton extends Button { 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 395720c53..7869b56ce 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,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Component = videojs.getComponent('Component') 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 d49ca0230..98e7f56fc 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 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { LoadedQualityData } from '../peertube-videojs-typings' import { ResolutionMenuItem } from './resolution-menu-item' 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 cb0d219ad..73ad47d2b 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 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { AutoResolutionUpdateData, ResolutionUpdateData } from '../peertube-videojs-typings' const MenuItem = videojs.getComponent('MenuItem') diff --git a/client/src/assets/player/videojs-components/settings-dialog.ts b/client/src/assets/player/videojs-components/settings-dialog.ts index 8fd5ad96c..41911e7e8 100644 --- a/client/src/assets/player/videojs-components/settings-dialog.ts +++ b/client/src/assets/player/videojs-components/settings-dialog.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Component = videojs.getComponent('Component') 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 749128bdc..011323267 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 @@ // Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu import { SettingsMenuItem } from './settings-menu-item' import { toTitleCase } from '../utils' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { SettingsDialog } from './settings-dialog' import { SettingsPanel } from './settings-panel' 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 8d364591b..f1342f179 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 @@ // Thanks to Yanko Shterev: https://github.com/yshterev/videojs-settings-menu import { toTitleCase } from '../utils' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { SettingsButton } from './settings-menu-button' import { SettingsDialog } from './settings-dialog' import { SettingsPanel } from './settings-panel' 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 6dee6d7df..d1582412c 100644 --- a/client/src/assets/player/videojs-components/settings-panel-child.ts +++ b/client/src/assets/player/videojs-components/settings-panel-child.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Component = videojs.getComponent('Component') diff --git a/client/src/assets/player/videojs-components/settings-panel.ts b/client/src/assets/player/videojs-components/settings-panel.ts index 833ee2f21..1ad8bb1fc 100644 --- a/client/src/assets/player/videojs-components/settings-panel.ts +++ b/client/src/assets/player/videojs-components/settings-panel.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' const Component = videojs.getComponent('Component') diff --git a/client/src/assets/player/videojs-components/theater-button.ts b/client/src/assets/player/videojs-components/theater-button.ts index 41875af71..f862ee224 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 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { saveTheaterInStore, getStoredTheater } from '../peertube-player-local-storage' const Button = videojs.getComponent('Button') diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 26fb5a245..cb3deacc6 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -1,4 +1,4 @@ -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import * as WebTorrent from 'webtorrent' import { renderVideo } from './video-renderer' import { LoadedQualityData, PlayerNetworkInfo, WebtorrentPluginOptions } from '../peertube-videojs-typings' diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 6616fab48..286757e5e 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -15,7 +15,7 @@ import { import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' import { PeerTubeEmbedApi } from './embed-api' import { TranslationsManager } from '../../assets/player/translations-manager' -import videojs from 'video.js/dist/alt/video.core.js' +import videojs from 'video.js' import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings' type Translations = { [ id: string ]: string } diff --git a/client/tsconfig.json b/client/tsconfig.json index d9e798f91..ce83a4f11 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -24,6 +24,7 @@ ], "baseUrl": "./", "paths": { + "video.js": [ "node_modules/video.js/core" ], "@app/*": [ "src/app/*" ], "@shared/*": [ "../shared/*" ], "fs": [ "src/shims/noop.ts" ], diff --git a/client/webpack/webpack.video-embed.js b/client/webpack/webpack.video-embed.js index 84ab83669..252040bb7 100644 --- a/client/webpack/webpack.video-embed.js +++ b/client/webpack/webpack.video-embed.js @@ -27,7 +27,7 @@ module.exports = function () { modules: [ helpers.root('src'), helpers.root('node_modules') ], alias: { - 'video.js$': path.resolve('node_modules/video.js/dist/alt/video.core.novtt.js') + 'video.js$': path.resolve('node_modules/video.js/core.js') } },