From 189ab8deb3623934e8cf53b0d36ff216f8494313 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Aug 2020 11:42:53 +0200 Subject: Add ability to disable peertube button link in embed --- .../src/app/+videos/+video-watch/modal/video-share.component.html | 7 +++++++ client/src/app/+videos/+video-watch/modal/video-share.component.ts | 7 +++++-- client/src/assets/player/utils.ts | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/src/app/+videos/+video-watch/modal/video-share.component.html b/client/src/app/+videos/+video-watch/modal/video-share.component.html index 5e6a2d518..71ae6544f 100644 --- a/client/src/app/+videos/+video-watch/modal/video-share.component.html +++ b/client/src/app/+videos/+video-watch/modal/video-share.component.html @@ -158,6 +158,13 @@ i18n-labelText labelText="Display player controls" > + +
+ +
diff --git a/client/src/app/+videos/+video-watch/modal/video-share.component.ts b/client/src/app/+videos/+video-watch/modal/video-share.component.ts index b42b775c1..23c562273 100644 --- a/client/src/app/+videos/+video-watch/modal/video-share.component.ts +++ b/client/src/app/+videos/+video-watch/modal/video-share.component.ts @@ -21,6 +21,7 @@ type Customizations = { title: boolean warningTitle: boolean controls: boolean + peertubeLink: boolean } @Component({ @@ -65,7 +66,8 @@ export class VideoShareComponent { // Embed options title: true, warningTitle: true, - controls: true + controls: true, + peertubeLink: true } this.modalService.open(this.modal, { centered: true }) @@ -120,7 +122,8 @@ export class VideoShareComponent { title: this.customizations.title, warningTitle: this.customizations.warningTitle, - controls: this.customizations.controls + controls: this.customizations.controls, + peertubeLink: this.customizations.peertubeLink } } } diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index 20d97c7e2..115fdfa49 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts @@ -58,6 +58,7 @@ function buildVideoLink (options: { title?: boolean, warningTitle?: boolean, controls?: boolean + peertubeLink?: boolean } = {}) { const { baseUrl } = options @@ -88,6 +89,7 @@ function buildVideoLink (options: { if (options.title === false) params.set('title', '0') if (options.warningTitle === false) params.set('warningTitle', '0') if (options.controls === false) params.set('controls', '0') + if (options.peertubeLink === false) params.set('peertubeLink', '0') let hasParams = false params.forEach(() => hasParams = true) -- cgit v1.2.3