diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-14 11:16:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-14 11:36:38 +0100 |
commit | 9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (patch) | |
tree | 62c98909b4eb30ece3c0f58c26c8555e6bef1e31 /client/src/assets/player/peertube-player-manager.ts | |
parent | 9af2accee68082e4e1160a4e4a7036451262be02 (diff) | |
download | PeerTube-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.ts | 21 |
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' | |||
10 | import './control-bar/p2p-info-button' | 10 | import './control-bar/p2p-info-button' |
11 | import './control-bar/peertube-link-button' | 11 | import './control-bar/peertube-link-button' |
12 | import './control-bar/peertube-load-progress-bar' | 12 | import './control-bar/peertube-load-progress-bar' |
13 | import './control-bar/resolution-menu-button' | ||
14 | import './control-bar/resolution-menu-item' | ||
15 | import './control-bar/settings-dialog' | ||
16 | import './control-bar/settings-menu-button' | ||
17 | import './control-bar/settings-menu-item' | ||
18 | import './control-bar/settings-panel' | ||
19 | import './control-bar/settings-panel-child' | ||
20 | import './control-bar/theater-button' | 13 | import './control-bar/theater-button' |
14 | import './settings/resolution-menu-button' | ||
15 | import './settings/resolution-menu-item' | ||
16 | import './settings/settings-dialog' | ||
17 | import './settings/settings-menu-button' | ||
18 | import './settings/settings-menu-item' | ||
19 | import './settings/settings-panel' | ||
20 | import './settings/settings-panel-child' | ||
21 | import './playlist/playlist-plugin' | 21 | import './playlist/playlist-plugin' |
22 | import './mobile/peertube-mobile-plugin' | 22 | import './mobile/peertube-mobile-plugin' |
23 | import './mobile/peertube-mobile-buttons' | 23 | import './mobile/peertube-mobile-buttons' |
24 | import './hotkeys/peertube-hotkeys-plugin' | 24 | import './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' | ||
28 | import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from './manager-options/manager-options.model' | ||
27 | import { saveAverageBandwidth } from './peertube-player-local-storage' | 29 | import { saveAverageBandwidth } from './peertube-player-local-storage' |
28 | import { CommonOptions, PeertubePlayerManagerOptions, PeertubePlayerOptionsBuilder, PlayerMode } from './peertube-player-options-builder' | ||
29 | import { PlayerNetworkInfo } from './peertube-videojs-typings' | 30 | import { PlayerNetworkInfo } from './peertube-videojs-typings' |
30 | import { TranslationsManager } from './translations-manager' | 31 | import { TranslationsManager } from './translations-manager' |
31 | import { isMobile } from './utils' | 32 | import { 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) |