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"
></my-peertube-checkbox>
</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>
</div>

View File

@ -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
}
}
}

View File

@ -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)