mirror of https://github.com/Chocobozzz/PeerTube
Fix button link on mobile
parent
fd7581b036
commit
c9c21fafdb
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue