1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 01:39:37 +02:00

Add ability to disable p2p in embed with URL

This commit is contained in:
Chocobozzz 2021-12-16 09:54:45 +01:00
parent b65de1be4d
commit 8530211822
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 46 additions and 14 deletions

View file

@ -45,6 +45,7 @@ export class PeerTubeEmbed {
title: boolean
warningTitle: boolean
peertubeLink: boolean
p2pEnabled: boolean
bigPlayBackgroundColor: string
foregroundColor: string
@ -284,6 +285,7 @@ export class PeerTubeEmbed {
this.enableApi = this.getParamToggle(params, 'api', this.enableApi)
this.warningTitle = this.getParamToggle(params, 'warningTitle', true)
this.peertubeLink = this.getParamToggle(params, 'peertubeLink', true)
this.p2pEnabled = this.getParamToggle(params, 'p2p', this.isP2PEnabled(video))
this.scope = this.getParamString(params, 'scope', this.scope)
this.subtitle = this.getParamString(params, 'subtitle')
@ -518,7 +520,7 @@ export class PeerTubeEmbed {
muted: this.muted,
loop: this.loop,
p2pEnabled: this.isP2PEnabled(videoInfo),
p2pEnabled: this.p2pEnabled,
captions: videoCaptions.length !== 0,
subtitle: this.subtitle,
@ -674,7 +676,7 @@ export class PeerTubeEmbed {
const title = this.title ? videoInfo.name : undefined
const description = this.warningTitle && this.isP2PEnabled(videoInfo)
const description = this.warningTitle && this.p2pEnabled
? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>'
: undefined