aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-18 13:32:20 +0100
committerChocobozzz <me@florianbigard.com>2022-03-18 13:32:20 +0100
commite71e2d8a8f29d4b21c1760a0971201fe59b5985e (patch)
tree54e1e58663009b464a179a75141cf2292238ca0e /client/src/assets/player/shared
parent57e4e1c1a95c3a81a967f54ecc2a510d8b0e129c (diff)
downloadPeerTube-e71e2d8a8f29d4b21c1760a0971201fe59b5985e.tar.gz
PeerTube-e71e2d8a8f29d4b21c1760a0971201fe59b5985e.tar.zst
PeerTube-e71e2d8a8f29d4b21c1760a0971201fe59b5985e.zip
Fix missing p2p media loader config for hls
Diffstat (limited to 'client/src/assets/player/shared')
-rw-r--r--client/src/assets/player/shared/manager-options/hls-options-builder.ts10
-rw-r--r--client/src/assets/player/shared/manager-options/manager-options-builder.ts6
2 files changed, 9 insertions, 7 deletions
diff --git a/client/src/assets/player/shared/manager-options/hls-options-builder.ts b/client/src/assets/player/shared/manager-options/hls-options-builder.ts
index e7f664fd4..1262cf4e8 100644
--- a/client/src/assets/player/shared/manager-options/hls-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/hls-options-builder.ts
@@ -46,13 +46,14 @@ export class HLSOptionsBuilder {
46 if (file.fps >= 50) label += file.fps 46 if (file.fps >= 50) label += file.fps
47 47
48 return label 48 return label
49 },
50 html5: {
51 hlsjsConfig: this.getHLSJSOptions(loader)
52 } 49 }
53 } 50 }
54 51
55 return { p2pMediaLoader, hlsjs } 52 const html5 = {
53 hlsjsConfig: this.getHLSJSOptions(loader)
54 }
55
56 return { p2pMediaLoader, hlsjs, html5 }
56 } 57 }
57 58
58 // --------------------------------------------------------------------------- 59 // ---------------------------------------------------------------------------
@@ -73,7 +74,6 @@ export class HLSOptionsBuilder {
73 74
74 return { 75 return {
75 loader: { 76 loader: {
76
77 trackerAnnounce, 77 trackerAnnounce,
78 rtcConfig: getRtcConfig(), 78 rtcConfig: getRtcConfig(),
79 79
diff --git a/client/src/assets/player/shared/manager-options/manager-options-builder.ts b/client/src/assets/player/shared/manager-options/manager-options-builder.ts
index 5dab1f7a9..29e851c1c 100644
--- a/client/src/assets/player/shared/manager-options/manager-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/manager-options-builder.ts
@@ -2,7 +2,7 @@ import videojs from 'video.js'
2import { copyToClipboard } from '@root-helpers/utils' 2import { copyToClipboard } from '@root-helpers/utils'
3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video' 3import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
4import { isIOS, isSafari } from '@root-helpers/web-browser' 4import { isIOS, isSafari } from '@root-helpers/web-browser'
5import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' 5import { buildVideoLink, decorateVideoLink, pick } from '@shared/core-utils'
6import { isDefaultLocale } from '@shared/core-utils/i18n' 6import { isDefaultLocale } from '@shared/core-utils/i18n'
7import { VideoJSPluginOptions } from '../../types' 7import { VideoJSPluginOptions } from '../../types'
8import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../types/manager-options' 8import { CommonOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../types/manager-options'
@@ -49,8 +49,10 @@ export class ManagerOptionsBuilder {
49 49
50 if (this.mode === 'p2p-media-loader') { 50 if (this.mode === 'p2p-media-loader') {
51 const hlsOptionsBuilder = new HLSOptionsBuilder(this.options, this.p2pMediaLoaderModule) 51 const hlsOptionsBuilder = new HLSOptionsBuilder(this.options, this.p2pMediaLoaderModule)
52 const options = hlsOptionsBuilder.getPluginOptions()
52 53
53 Object.assign(plugins, hlsOptionsBuilder.getPluginOptions()) 54 Object.assign(plugins, pick(options, [ 'hlsjs', 'p2pMediaLoader' ]))
55 Object.assign(html5, options.html5)
54 } else if (this.mode === 'webtorrent') { 56 } else if (this.mode === 'webtorrent') {
55 const webtorrentOptionsBuilder = new WebTorrentOptionsBuilder(this.options, this.getAutoPlayValue(autoplay, alreadyPlayed)) 57 const webtorrentOptionsBuilder = new WebTorrentOptionsBuilder(this.options, this.getAutoPlayValue(autoplay, alreadyPlayed))
56 58