diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-16 09:54:45 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 10:08:55 +0100 |
commit | 85302118227bad232afdebb84a5c245f862366bd (patch) | |
tree | a3969d4bc60763c2318e95674386c8a4f1e3f6c6 /client/src/standalone/videos | |
parent | b65de1be4dcf626c552be613d531d3f6e23c6085 (diff) | |
download | PeerTube-85302118227bad232afdebb84a5c245f862366bd.tar.gz PeerTube-85302118227bad232afdebb84a5c245f862366bd.tar.zst PeerTube-85302118227bad232afdebb84a5c245f862366bd.zip |
Add ability to disable p2p in embed with URL
Diffstat (limited to 'client/src/standalone/videos')
-rw-r--r-- | client/src/standalone/videos/embed.ts | 6 |
1 files changed, 4 insertions, 2 deletions
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 { | |||
45 | title: boolean | 45 | title: boolean |
46 | warningTitle: boolean | 46 | warningTitle: boolean |
47 | peertubeLink: boolean | 47 | peertubeLink: boolean |
48 | p2pEnabled: boolean | ||
48 | bigPlayBackgroundColor: string | 49 | bigPlayBackgroundColor: string |
49 | foregroundColor: string | 50 | foregroundColor: string |
50 | 51 | ||
@@ -284,6 +285,7 @@ export class PeerTubeEmbed { | |||
284 | this.enableApi = this.getParamToggle(params, 'api', this.enableApi) | 285 | this.enableApi = this.getParamToggle(params, 'api', this.enableApi) |
285 | this.warningTitle = this.getParamToggle(params, 'warningTitle', true) | 286 | this.warningTitle = this.getParamToggle(params, 'warningTitle', true) |
286 | this.peertubeLink = this.getParamToggle(params, 'peertubeLink', true) | 287 | this.peertubeLink = this.getParamToggle(params, 'peertubeLink', true) |
288 | this.p2pEnabled = this.getParamToggle(params, 'p2p', this.isP2PEnabled(video)) | ||
287 | 289 | ||
288 | this.scope = this.getParamString(params, 'scope', this.scope) | 290 | this.scope = this.getParamString(params, 'scope', this.scope) |
289 | this.subtitle = this.getParamString(params, 'subtitle') | 291 | this.subtitle = this.getParamString(params, 'subtitle') |
@@ -518,7 +520,7 @@ export class PeerTubeEmbed { | |||
518 | muted: this.muted, | 520 | muted: this.muted, |
519 | loop: this.loop, | 521 | loop: this.loop, |
520 | 522 | ||
521 | p2pEnabled: this.isP2PEnabled(videoInfo), | 523 | p2pEnabled: this.p2pEnabled, |
522 | 524 | ||
523 | captions: videoCaptions.length !== 0, | 525 | captions: videoCaptions.length !== 0, |
524 | subtitle: this.subtitle, | 526 | subtitle: this.subtitle, |
@@ -674,7 +676,7 @@ export class PeerTubeEmbed { | |||
674 | 676 | ||
675 | const title = this.title ? videoInfo.name : undefined | 677 | const title = this.title ? videoInfo.name : undefined |
676 | 678 | ||
677 | const description = this.warningTitle && this.isP2PEnabled(videoInfo) | 679 | const description = this.warningTitle && this.p2pEnabled |
678 | ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>' | 680 | ? '<span class="text">' + peertubeTranslate('Watching this video may reveal your IP address to others.') + '</span>' |
679 | : undefined | 681 | : undefined |
680 | 682 | ||