aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-14 11:16:54 +0100
committerChocobozzz <me@florianbigard.com>2022-03-14 11:36:38 +0100
commit9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (patch)
tree62c98909b4eb30ece3c0f58c26c8555e6bef1e31 /client/src/assets/player/peertube-player-manager.ts
parent9af2accee68082e4e1160a4e4a7036451262be02 (diff)
downloadPeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.tar.gz
PeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.tar.zst
PeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.zip
Reorganize player manager options builder
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r--client/src/assets/player/peertube-player-manager.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 81ddb8814..ddb521a52 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -10,22 +10,23 @@ import './control-bar/next-previous-video-button'
10import './control-bar/p2p-info-button' 10import './control-bar/p2p-info-button'
11import './control-bar/peertube-link-button' 11import './control-bar/peertube-link-button'
12import './control-bar/peertube-load-progress-bar' 12import './control-bar/peertube-load-progress-bar'
13import './control-bar/resolution-menu-button'
14import './control-bar/resolution-menu-item'
15import './control-bar/settings-dialog'
16import './control-bar/settings-menu-button'
17import './control-bar/settings-menu-item'
18import './control-bar/settings-panel'
19import './control-bar/settings-panel-child'
20import './control-bar/theater-button' 13import './control-bar/theater-button'
14import './settings/resolution-menu-button'
15import './settings/resolution-menu-item'
16import './settings/settings-dialog'
17import './settings/settings-menu-button'
18import './settings/settings-menu-item'
19import './settings/settings-panel'
20import './settings/settings-panel-child'
21import './playlist/playlist-plugin' 21import './playlist/playlist-plugin'
22import './mobile/peertube-mobile-plugin' 22import './mobile/peertube-mobile-plugin'
23import './mobile/peertube-mobile-buttons' 23import './mobile/peertube-mobile-buttons'
24import './hotkeys/peertube-hotkeys-plugin' 24import './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'
28import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options/manager-options.model'
27import { saveAverageBandwidth } from './peertube-player-local-storage' 29import { saveAverageBandwidth } from './peertube-player-local-storage'
28import { CommonOptions, PeertubePlayerManagerOptions, PeertubePlayerOptionsBuilder, PlayerMode } from './peertube-player-options-builder'
29import { PlayerNetworkInfo } from './peertube-videojs-typings' 30import { PlayerNetworkInfo } from './peertube-videojs-typings'
30import { TranslationsManager } from './translations-manager' 31import { TranslationsManager } from './translations-manager'
31import { isMobile } from './utils' 32import { isMobile } from './utils'
@@ -75,7 +76,7 @@ export class PeertubePlayerManager {
75 } 76 }
76 77
77 private static async buildPlayer (mode: PlayerMode, options: PeertubePlayerManagerOptions): Promise<videojs.Player> { 78 private static async buildPlayer (mode: PlayerMode, options: PeertubePlayerManagerOptions): Promise<videojs.Player> {
78 const videojsOptionsBuilder = new PeertubePlayerOptionsBuilder(mode, options, this.p2pMediaLoaderModule) 79 const videojsOptionsBuilder = new ManagerOptionsBuilder(mode, options, this.p2pMediaLoaderModule)
79 80
80 const videojsOptions = await this.pluginsManager.runHook( 81 const videojsOptions = await this.pluginsManager.runHook(
81 'filter:internal.player.videojs.options.result', 82 'filter:internal.player.videojs.options.result',
@@ -198,7 +199,7 @@ export class PeertubePlayerManager {
198 return newVideoElement 199 return newVideoElement
199 } 200 }
200 201
201 private static addContextMenu (optionsBuilder: PeertubePlayerOptionsBuilder, player: videojs.Player, commonOptions: CommonOptions) { 202 private static addContextMenu (optionsBuilder: ManagerOptionsBuilder, player: videojs.Player, commonOptions: CommonOptions) {
202 const options = optionsBuilder.getContextMenuOptions(player, commonOptions) 203 const options = optionsBuilder.getContextMenuOptions(player, commonOptions)
203 204
204 player.contextmenuUI(options) 205 player.contextmenuUI(options)