aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r--client/src/assets/player/peertube-player-manager.ts59
1 files changed, 29 insertions, 30 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index ddb521a52..1b2a67c77 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -1,35 +1,34 @@
1import '@peertube/videojs-contextmenu' 1import '@peertube/videojs-contextmenu'
2import './upnext/end-card' 2import './shared/upnext/end-card'
3import './upnext/upnext-plugin' 3import './shared/upnext/upnext-plugin'
4import './stats/stats-card' 4import './shared/stats/stats-card'
5import './stats/stats-plugin' 5import './shared/stats/stats-plugin'
6import './bezels/bezels-plugin' 6import './shared/bezels/bezels-plugin'
7import './peertube-plugin' 7import './shared/peertube/peertube-plugin'
8import './peertube-resolutions-plugin' 8import './shared/resolutions/peertube-resolutions-plugin'
9import './control-bar/next-previous-video-button' 9import './shared/control-bar/next-previous-video-button'
10import './control-bar/p2p-info-button' 10import './shared/control-bar/p2p-info-button'
11import './control-bar/peertube-link-button' 11import './shared/control-bar/peertube-link-button'
12import './control-bar/peertube-load-progress-bar' 12import './shared/control-bar/peertube-load-progress-bar'
13import './control-bar/theater-button' 13import './shared/control-bar/theater-button'
14import './settings/resolution-menu-button' 14import './shared/settings/resolution-menu-button'
15import './settings/resolution-menu-item' 15import './shared/settings/resolution-menu-item'
16import './settings/settings-dialog' 16import './shared/settings/settings-dialog'
17import './settings/settings-menu-button' 17import './shared/settings/settings-menu-button'
18import './settings/settings-menu-item' 18import './shared/settings/settings-menu-item'
19import './settings/settings-panel' 19import './shared/settings/settings-panel'
20import './settings/settings-panel-child' 20import './shared/settings/settings-panel-child'
21import './playlist/playlist-plugin' 21import './shared/playlist/playlist-plugin'
22import './mobile/peertube-mobile-plugin' 22import './shared/mobile/peertube-mobile-plugin'
23import './mobile/peertube-mobile-buttons' 23import './shared/mobile/peertube-mobile-buttons'
24import './hotkeys/peertube-hotkeys-plugin' 24import './shared/hotkeys/peertube-hotkeys-plugin'
25import videojs from 'video.js' 25import videojs from 'video.js'
26import { PluginsManager } from '@root-helpers/plugins-manager' 26import { PluginsManager } from '@root-helpers/plugins-manager'
27import { ManagerOptionsBuilder } from './manager-options/manager-options-builder' 27import { isMobile } from '@root-helpers/web-browser'
28import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options/manager-options.model'
29import { saveAverageBandwidth } from './peertube-player-local-storage' 28import { saveAverageBandwidth } from './peertube-player-local-storage'
30import { PlayerNetworkInfo } from './peertube-videojs-typings' 29import { ManagerOptionsBuilder } from './shared/manager-options'
31import { TranslationsManager } from './translations-manager' 30import { TranslationsManager } from './translations-manager'
32import { isMobile } from './utils' 31import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode, PlayerNetworkInfo } from './types'
33 32
34// Change 'Playback Rate' to 'Speed' (smaller for our settings menu) 33// Change 'Playback Rate' to 'Speed' (smaller for our settings menu)
35(videojs.getComponent('PlaybackRateMenuButton') as any).prototype.controlText_ = 'Speed' 34(videojs.getComponent('PlaybackRateMenuButton') as any).prototype.controlText_ = 'Speed'
@@ -60,11 +59,11 @@ export class PeertubePlayerManager {
60 this.onPlayerChange = onPlayerChange 59 this.onPlayerChange = onPlayerChange
61 this.playerElementClassName = options.common.playerElement.className 60 this.playerElementClassName = options.common.playerElement.className
62 61
63 if (mode === 'webtorrent') await import('./webtorrent/webtorrent-plugin') 62 if (mode === 'webtorrent') await import('./shared/webtorrent/webtorrent-plugin')
64 if (mode === 'p2p-media-loader') { 63 if (mode === 'p2p-media-loader') {
65 const [ p2pMediaLoaderModule ] = await Promise.all([ 64 const [ p2pMediaLoaderModule ] = await Promise.all([
66 import('@peertube/p2p-media-loader-hlsjs'), 65 import('@peertube/p2p-media-loader-hlsjs'),
67 import('./p2p-media-loader/p2p-media-loader-plugin') 66 import('./shared/p2p-media-loader/p2p-media-loader-plugin')
68 ]) 67 ])
69 68
70 this.p2pMediaLoaderModule = p2pMediaLoaderModule 69 this.p2pMediaLoaderModule = p2pMediaLoaderModule
@@ -174,7 +173,7 @@ export class PeertubePlayerManager {
174 173
175 this.rebuildAndUpdateVideoElement(currentPlayer, options.common) 174 this.rebuildAndUpdateVideoElement(currentPlayer, options.common)
176 175
177 await import('./webtorrent/webtorrent-plugin') 176 await import('./shared/webtorrent/webtorrent-plugin')
178 177
179 const newPlayer = await this.buildPlayer('webtorrent', options) 178 const newPlayer = await this.buildPlayer('webtorrent', options)
180 this.onPlayerChange(newPlayer) 179 this.onPlayerChange(newPlayer)