diff options
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 59 |
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 @@ | |||
1 | import '@peertube/videojs-contextmenu' | 1 | import '@peertube/videojs-contextmenu' |
2 | import './upnext/end-card' | 2 | import './shared/upnext/end-card' |
3 | import './upnext/upnext-plugin' | 3 | import './shared/upnext/upnext-plugin' |
4 | import './stats/stats-card' | 4 | import './shared/stats/stats-card' |
5 | import './stats/stats-plugin' | 5 | import './shared/stats/stats-plugin' |
6 | import './bezels/bezels-plugin' | 6 | import './shared/bezels/bezels-plugin' |
7 | import './peertube-plugin' | 7 | import './shared/peertube/peertube-plugin' |
8 | import './peertube-resolutions-plugin' | 8 | import './shared/resolutions/peertube-resolutions-plugin' |
9 | import './control-bar/next-previous-video-button' | 9 | import './shared/control-bar/next-previous-video-button' |
10 | import './control-bar/p2p-info-button' | 10 | import './shared/control-bar/p2p-info-button' |
11 | import './control-bar/peertube-link-button' | 11 | import './shared/control-bar/peertube-link-button' |
12 | import './control-bar/peertube-load-progress-bar' | 12 | import './shared/control-bar/peertube-load-progress-bar' |
13 | import './control-bar/theater-button' | 13 | import './shared/control-bar/theater-button' |
14 | import './settings/resolution-menu-button' | 14 | import './shared/settings/resolution-menu-button' |
15 | import './settings/resolution-menu-item' | 15 | import './shared/settings/resolution-menu-item' |
16 | import './settings/settings-dialog' | 16 | import './shared/settings/settings-dialog' |
17 | import './settings/settings-menu-button' | 17 | import './shared/settings/settings-menu-button' |
18 | import './settings/settings-menu-item' | 18 | import './shared/settings/settings-menu-item' |
19 | import './settings/settings-panel' | 19 | import './shared/settings/settings-panel' |
20 | import './settings/settings-panel-child' | 20 | import './shared/settings/settings-panel-child' |
21 | import './playlist/playlist-plugin' | 21 | import './shared/playlist/playlist-plugin' |
22 | import './mobile/peertube-mobile-plugin' | 22 | import './shared/mobile/peertube-mobile-plugin' |
23 | import './mobile/peertube-mobile-buttons' | 23 | import './shared/mobile/peertube-mobile-buttons' |
24 | import './hotkeys/peertube-hotkeys-plugin' | 24 | import './shared/hotkeys/peertube-hotkeys-plugin' |
25 | import videojs from 'video.js' | 25 | import videojs from 'video.js' |
26 | import { PluginsManager } from '@root-helpers/plugins-manager' | 26 | import { PluginsManager } from '@root-helpers/plugins-manager' |
27 | import { ManagerOptionsBuilder } from './manager-options/manager-options-builder' | 27 | import { isMobile } from '@root-helpers/web-browser' |
28 | import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options/manager-options.model' | ||
29 | import { saveAverageBandwidth } from './peertube-player-local-storage' | 28 | import { saveAverageBandwidth } from './peertube-player-local-storage' |
30 | import { PlayerNetworkInfo } from './peertube-videojs-typings' | 29 | import { ManagerOptionsBuilder } from './shared/manager-options' |
31 | import { TranslationsManager } from './translations-manager' | 30 | import { TranslationsManager } from './translations-manager' |
32 | import { isMobile } from './utils' | 31 | import { 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) |