Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix button link on mobile

Chocobozzzc9c21fafdb48
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 a9b432b8c5..45d7ac42f8 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'
import { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
import { PeerTubeLinkButtonOptions } from '../../types'
-const Button = videojs.getComponent('Button')
-class PeerTubeLinkButton extends Button {
+const Component = videojs.getComponent('Component')
+class PeerTubeLinkButton extends Component {
constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) {
super(player, options as any)
@@ -17,10 +17,6 @@ class PeerTubeLinkButton extends Button {
this.el().setAttribute('href', this.buildLink())
}
- handleClick () {
- this.player().pause()
- }
-
private buildElement () {
const el = videojs.dom.createEl('a', {
href: this.buildLink(),
@@ -31,6 +27,7 @@ class PeerTubeLinkButton extends Button {
})
el.addEventListener('mouseenter', () => this.updateHref())
+ el.addEventListener('click', () => this.player().pause())
return el as HTMLButtonElement
}
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index 66dbbfcb8b..7d03346a0b 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -64,6 +64,7 @@ const playerKeys = {
' (muted)': ' (muted)',
'{1} from servers · {2} from peers': '{1} from servers · {2} from peers',
'Previous video': 'Previous video',
+ 'Video page (new window)': 'Video page (new window)',
'Next video': 'Next video'
}
Object.assign(playerKeys, videojs)