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.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 083c621d2..6c8b13087 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -86,6 +86,7 @@ export class PeertubePlayerManager {
86 86
87 private static videojsLocaleCache: { [ path: string ]: any } = {} 87 private static videojsLocaleCache: { [ path: string ]: any } = {}
88 private static playerElementClassName: string 88 private static playerElementClassName: string
89 private static onPlayerChange: (player: any) => void
89 90
90 static getServerTranslations (serverUrl: string, locale: string) { 91 static getServerTranslations (serverUrl: string, locale: string) {
91 const path = PeertubePlayerManager.getLocalePath(serverUrl, locale) 92 const path = PeertubePlayerManager.getLocalePath(serverUrl, locale)
@@ -100,9 +101,10 @@ export class PeertubePlayerManager {
100 }) 101 })
101 } 102 }
102 103
103 static async initialize (mode: PlayerMode, options: PeertubePlayerManagerOptions) { 104 static async initialize (mode: PlayerMode, options: PeertubePlayerManagerOptions, onPlayerChange: (player: any) => void) {
104 let p2pMediaLoader: any 105 let p2pMediaLoader: any
105 106
107 this.onPlayerChange = onPlayerChange
106 this.playerElementClassName = options.common.playerElement.className 108 this.playerElementClassName = options.common.playerElement.className
107 109
108 if (mode === 'webtorrent') await import('./webtorrent/webtorrent-plugin') 110 if (mode === 'webtorrent') await import('./webtorrent/webtorrent-plugin')
@@ -171,6 +173,8 @@ export class PeertubePlayerManager {
171 const player = this 173 const player = this
172 174
173 self.addContextMenu(mode, player, options.common.embedUrl) 175 self.addContextMenu(mode, player, options.common.embedUrl)
176
177 PeertubePlayerManager.onPlayerChange(player)
174 }) 178 })
175 } 179 }
176 180