1
0
Fork 0

Fix button link on mobile

This commit is contained in:
Chocobozzz 2023-02-15 10:27:26 +01:00
parent fd7581b036
commit c9c21fafdb
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 6 deletions

View File

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

View File

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