1
0
Fork 0

Add ability to disable peertube button link in embed

This commit is contained in:
Chocobozzz 2020-08-07 11:42:53 +02:00
parent 193b9ba7c0
commit 189ab8deb3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 14 additions and 2 deletions

View file

@ -158,6 +158,13 @@
i18n-labelText labelText="Display player controls" i18n-labelText labelText="Display player controls"
></my-peertube-checkbox> ></my-peertube-checkbox>
</div> </div>
<div class="form-group">
<my-peertube-checkbox
inputName="controls" [(ngModel)]="customizations.peertubeLink"
i18n-labelText labelText="Display PeerTube button link"
></my-peertube-checkbox>
</div>
</ng-container> </ng-container>
</div> </div>

View file

@ -21,6 +21,7 @@ type Customizations = {
title: boolean title: boolean
warningTitle: boolean warningTitle: boolean
controls: boolean controls: boolean
peertubeLink: boolean
} }
@Component({ @Component({
@ -65,7 +66,8 @@ export class VideoShareComponent {
// Embed options // Embed options
title: true, title: true,
warningTitle: true, warningTitle: true,
controls: true controls: true,
peertubeLink: true
} }
this.modalService.open(this.modal, { centered: true }) this.modalService.open(this.modal, { centered: true })
@ -120,7 +122,8 @@ export class VideoShareComponent {
title: this.customizations.title, title: this.customizations.title,
warningTitle: this.customizations.warningTitle, warningTitle: this.customizations.warningTitle,
controls: this.customizations.controls controls: this.customizations.controls,
peertubeLink: this.customizations.peertubeLink
} }
} }
} }

View file

@ -58,6 +58,7 @@ function buildVideoLink (options: {
title?: boolean, title?: boolean,
warningTitle?: boolean, warningTitle?: boolean,
controls?: boolean controls?: boolean
peertubeLink?: boolean
} = {}) { } = {}) {
const { baseUrl } = options const { baseUrl } = options
@ -88,6 +89,7 @@ function buildVideoLink (options: {
if (options.title === false) params.set('title', '0') if (options.title === false) params.set('title', '0')
if (options.warningTitle === false) params.set('warningTitle', '0') if (options.warningTitle === false) params.set('warningTitle', '0')
if (options.controls === false) params.set('controls', '0') if (options.controls === false) params.set('controls', '0')
if (options.peertubeLink === false) params.set('peertubeLink', '0')
let hasParams = false let hasParams = false
params.forEach(() => hasParams = true) params.forEach(() => hasParams = true)