From 85302118227bad232afdebb84a5c245f862366bd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 16 Dec 2021 09:54:45 +0100 Subject: Add ability to disable p2p in embed with URL --- client/src/standalone/videos/embed.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client/src/standalone/videos/embed.ts') diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index c04f94d20..eb8076b98 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -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 ? '' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '' : undefined -- cgit v1.2.3