aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets
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
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')
-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
-rw-r--r--client/src/assets/player/types/manager-options.ts2
-rw-r--r--client/src/assets/player/types/peertube-videojs-typings.ts1
4 files changed, 10 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
diff --git a/client/src/assets/player/types/manager-options.ts b/client/src/assets/player/types/manager-options.ts
index a6f00876f..cadce739d 100644
--- a/client/src/assets/player/types/manager-options.ts
+++ b/client/src/assets/player/types/manager-options.ts
@@ -51,6 +51,8 @@ export interface CommonOptions extends CustomizationOptions {
51 inactivityTimeout: number 51 inactivityTimeout: number
52 poster: string 52 poster: string
53 53
54 instanceName: string
55
54 theaterButton: boolean 56 theaterButton: boolean
55 captions: boolean 57 captions: boolean
56 58
diff --git a/client/src/assets/player/types/peertube-videojs-typings.ts b/client/src/assets/player/types/peertube-videojs-typings.ts
index ad284a671..115afb614 100644
--- a/client/src/assets/player/types/peertube-videojs-typings.ts
+++ b/client/src/assets/player/types/peertube-videojs-typings.ts
@@ -127,6 +127,7 @@ type NextPreviousVideoButtonOptions = {
127 127
128type PeerTubeLinkButtonOptions = { 128type PeerTubeLinkButtonOptions = {
129 shortUUID: string 129 shortUUID: string
130 instanceName: string
130} 131}
131 132
132type PeerTubeP2PInfoButtonOptions = { 133type PeerTubeP2PInfoButtonOptions = {