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.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 9155c0698..2e090847c 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -24,17 +24,17 @@ videojsUntyped.getComponent('CaptionsButton').prototype.controlText_ = 'Subtitle
24// We just want to display 'Off' instead of 'captions off', keep a space so the variable == true (hacky I know) 24// We just want to display 'Off' instead of 'captions off', keep a space so the variable == true (hacky I know)
25videojsUntyped.getComponent('CaptionsButton').prototype.label_ = ' ' 25videojsUntyped.getComponent('CaptionsButton').prototype.label_ = ' '
26 26
27type PlayerMode = 'webtorrent' | 'p2p-media-loader' 27export type PlayerMode = 'webtorrent' | 'p2p-media-loader'
28 28
29type WebtorrentOptions = { 29export type WebtorrentOptions = {
30 videoFiles: VideoFile[] 30 videoFiles: VideoFile[]
31} 31}
32 32
33type P2PMediaLoaderOptions = { 33export type P2PMediaLoaderOptions = {
34 playlistUrl: string 34 playlistUrl: string
35} 35}
36 36
37type CommonOptions = { 37export type CommonOptions = {
38 playerElement: HTMLVideoElement 38 playerElement: HTMLVideoElement
39 39
40 autoplay: boolean 40 autoplay: boolean
@@ -137,6 +137,7 @@ export class PeertubePlayerManager {
137 const commonOptions = options.common 137 const commonOptions = options.common
138 const webtorrentOptions = options.webtorrent 138 const webtorrentOptions = options.webtorrent
139 const p2pMediaLoaderOptions = options.p2pMediaLoader 139 const p2pMediaLoaderOptions = options.p2pMediaLoader
140 let html5 = {}
140 141
141 const plugins: VideoJSPluginOptions = { 142 const plugins: VideoJSPluginOptions = {
142 peertube: { 143 peertube: {
@@ -171,6 +172,7 @@ export class PeertubePlayerManager {
171 } 172 }
172 173
173 Object.assign(plugins, { p2pMediaLoader, streamrootHls }) 174 Object.assign(plugins, { p2pMediaLoader, streamrootHls })
175 html5 = streamrootHls.html5
174 } 176 }
175 177
176 if (webtorrentOptions) { 178 if (webtorrentOptions) {
@@ -184,6 +186,8 @@ export class PeertubePlayerManager {
184 } 186 }
185 187
186 const videojsOptions = { 188 const videojsOptions = {
189 html5,
190
187 // We don't use text track settings for now 191 // We don't use text track settings for now
188 textTrackSettings: false, 192 textTrackSettings: false,
189 controls: commonOptions.controls !== undefined ? commonOptions.controls : true, 193 controls: commonOptions.controls !== undefined ? commonOptions.controls : true,