]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix missing p2p media loader config for hls
authorChocobozzz <me@florianbigard.com>
Fri, 18 Mar 2022 12:32:20 +0000 (13:32 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 18 Mar 2022 12:32:20 +0000 (13:32 +0100)
client/src/assets/player/shared/manager-options/hls-options-builder.ts
client/src/assets/player/shared/manager-options/manager-options-builder.ts

index e7f664fd446f03c8bf07c96299bb8a338e3cc455..1262cf4e898ef4a16989624d6c92fbc83ece380e 100644 (file)
@@ -46,13 +46,14 @@ export class HLSOptionsBuilder {
         if (file.fps >= 50) label += file.fps
 
         return label
-      },
-      html5: {
-        hlsjsConfig: this.getHLSJSOptions(loader)
       }
     }
 
-    return { p2pMediaLoader, hlsjs }
+    const html5 = {
+      hlsjsConfig: this.getHLSJSOptions(loader)
+    }
+
+    return { p2pMediaLoader, hlsjs, html5 }
   }
 
   // ---------------------------------------------------------------------------
@@ -73,7 +74,6 @@ export class HLSOptionsBuilder {
 
     return {
       loader: {
-
         trackerAnnounce,
         rtcConfig: getRtcConfig(),
 
index 5dab1f7a9cce49c3112f8637c6d924fb0e8329a2..29e851c1c72ae0a2ac20b2022ed19a1d8c0fb6a9 100644 (file)
@@ -2,7 +2,7 @@ import videojs from 'video.js'
 import { copyToClipboard } from '@root-helpers/utils'
 import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
 import { isIOS, isSafari } from '@root-helpers/web-browser'
-import { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
+import { buildVideoLink, decorateVideoLink, pick } from '@shared/core-utils'
 import { isDefaultLocale } from '@shared/core-utils/i18n'
 import { VideoJSPluginOptions } from '../../types'
 import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../types/manager-options'
@@ -49,8 +49,10 @@ export class ManagerOptionsBuilder {
 
     if (this.mode === 'p2p-media-loader') {
       const hlsOptionsBuilder = new HLSOptionsBuilder(this.options, this.p2pMediaLoaderModule)
+      const options = hlsOptionsBuilder.getPluginOptions()
 
-      Object.assign(plugins, hlsOptionsBuilder.getPluginOptions())
+      Object.assign(plugins, pick(options, [ 'hlsjs', 'p2pMediaLoader' ]))
+      Object.assign(html5, options.html5)
     } else if (this.mode === 'webtorrent') {
       const webtorrentOptionsBuilder = new WebTorrentOptionsBuilder(this.options, this.getAutoPlayValue(autoplay, alreadyPlayed))