aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-28 14:04:03 +0200
committerChocobozzz <me@florianbigard.com>2022-06-28 14:11:10 +0200
commitbd2b51be4b29e6c3c72d8715164cde672bd41186 (patch)
treef3d54d1a49dffacd073dedc288fa8f7c2e7f7683 /client/src/assets/player/shared
parent9f4109e263be961ab0b210fcbc003a8c78f5b9fe (diff)
downloadPeerTube-bd2b51be4b29e6c3c72d8715164cde672bd41186.tar.gz
PeerTube-bd2b51be4b29e6c3c72d8715164cde672bd41186.tar.zst
PeerTube-bd2b51be4b29e6c3c72d8715164cde672bd41186.zip
Put instance name in embed button
Diffstat (limited to 'client/src/assets/player/shared')
-rw-r--r--client/src/assets/player/shared/control-bar/peertube-link-button.ts4
-rw-r--r--client/src/assets/player/shared/manager-options/control-bar-options-builder.ts5
2 files changed, 7 insertions, 2 deletions
diff --git a/client/src/assets/player/shared/control-bar/peertube-link-button.ts b/client/src/assets/player/shared/control-bar/peertube-link-button.ts
index 6d83263cc..4687525a9 100644
--- a/client/src/assets/player/shared/control-bar/peertube-link-button.ts
+++ b/client/src/assets/player/shared/control-bar/peertube-link-button.ts
@@ -5,6 +5,8 @@ import { PeerTubeLinkButtonOptions } from '../../types'
5const Button = videojs.getComponent('Button') 5const Button = videojs.getComponent('Button')
6class PeerTubeLinkButton extends Button { 6class PeerTubeLinkButton extends Button {
7 7
8 private instanceName: string
9
8 constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) { 10 constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) {
9 super(player, options as any) 11 super(player, options as any)
10 } 12 }
@@ -24,7 +26,7 @@ class PeerTubeLinkButton extends Button {
24 private buildElement () { 26 private buildElement () {
25 const el = videojs.dom.createEl('a', { 27 const el = videojs.dom.createEl('a', {
26 href: this.buildLink(), 28 href: this.buildLink(),
27 innerHTML: 'PeerTube', 29 innerHTML: (this.options_ as PeerTubeLinkButtonOptions).instanceName,
28 title: this.player().localize('Video page (new window)'), 30 title: this.player().localize('Video page (new window)'),
29 className: 'vjs-peertube-link', 31 className: 'vjs-peertube-link',
30 target: '_blank' 32 target: '_blank'
diff --git a/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts b/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts
index 72a10eb26..27f366732 100644
--- a/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts
+++ b/client/src/assets/player/shared/manager-options/control-bar-options-builder.ts
@@ -51,7 +51,10 @@ export class ControlBarOptionsBuilder {
51 51
52 if (this.options.peertubeLink === true) { 52 if (this.options.peertubeLink === true) {
53 Object.assign(children, { 53 Object.assign(children, {
54 peerTubeLinkButton: { shortUUID: this.options.videoShortUUID } as PeerTubeLinkButtonOptions 54 peerTubeLinkButton: {
55 shortUUID: this.options.videoShortUUID,
56 instanceName: this.options.instanceName
57 } as PeerTubeLinkButtonOptions
55 }) 58 })
56 } 59 }
57 60