aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-15 10:27:26 +0100
committerChocobozzz <me@florianbigard.com>2023-02-15 10:27:26 +0100
commitc9c21fafdb481a4bbb661229f6dc3e2b673ab3c6 (patch)
tree0808a4908f118bd1e20dfcddf2793f2e92f8a235
parentfd7581b036d9e3580e2e0b1e20d7e4c771d8ff83 (diff)
downloadPeerTube-c9c21fafdb481a4bbb661229f6dc3e2b673ab3c6.tar.gz
PeerTube-c9c21fafdb481a4bbb661229f6dc3e2b673ab3c6.tar.zst
PeerTube-c9c21fafdb481a4bbb661229f6dc3e2b673ab3c6.zip
Fix button link on mobile
-rw-r--r--client/src/assets/player/shared/control-bar/peertube-link-button.ts9
-rwxr-xr-xscripts/i18n/create-custom-files.ts1
2 files changed, 4 insertions, 6 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 a9b432b8c..45d7ac42f 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
@@ -2,8 +2,8 @@ import videojs from 'video.js'
2import { buildVideoLink, decorateVideoLink } from '@shared/core-utils' 2import { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
3import { PeerTubeLinkButtonOptions } from '../../types' 3import { PeerTubeLinkButtonOptions } from '../../types'
4 4
5const Button = videojs.getComponent('Button') 5const Component = videojs.getComponent('Component')
6class PeerTubeLinkButton extends Button { 6class PeerTubeLinkButton extends Component {
7 7
8 constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) { 8 constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) {
9 super(player, options as any) 9 super(player, options as any)
@@ -17,10 +17,6 @@ class PeerTubeLinkButton extends Button {
17 this.el().setAttribute('href', this.buildLink()) 17 this.el().setAttribute('href', this.buildLink())
18 } 18 }
19 19
20 handleClick () {
21 this.player().pause()
22 }
23
24 private buildElement () { 20 private buildElement () {
25 const el = videojs.dom.createEl('a', { 21 const el = videojs.dom.createEl('a', {
26 href: this.buildLink(), 22 href: this.buildLink(),
@@ -31,6 +27,7 @@ class PeerTubeLinkButton extends Button {
31 }) 27 })
32 28
33 el.addEventListener('mouseenter', () => this.updateHref()) 29 el.addEventListener('mouseenter', () => this.updateHref())
30 el.addEventListener('click', () => this.player().pause())
34 31
35 return el as HTMLButtonElement 32 return el as HTMLButtonElement
36 } 33 }
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 66dbbfcb8..7d03346a0 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -64,6 +64,7 @@ const playerKeys = {
64 ' (muted)': ' (muted)', 64 ' (muted)': ' (muted)',
65 '{1} from servers · {2} from peers': '{1} from servers · {2} from peers', 65 '{1} from servers · {2} from peers': '{1} from servers · {2} from peers',
66 'Previous video': 'Previous video', 66 'Previous video': 'Previous video',
67 'Video page (new window)': 'Video page (new window)',
67 'Next video': 'Next video' 68 'Next video': 'Next video'
68} 69}
69Object.assign(playerKeys, videojs) 70Object.assign(playerKeys, videojs)