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 { buildVideoLink, decorateVideoLink } from '@shared/core-utils'
|
||||||
import { PeerTubeLinkButtonOptions } from '../../types'
|
import { PeerTubeLinkButtonOptions } from '../../types'
|
||||||
|
|
||||||
const Button = videojs.getComponent('Button')
|
const Component = videojs.getComponent('Component')
|
||||||
class PeerTubeLinkButton extends Button {
|
class PeerTubeLinkButton extends Component {
|
||||||
|
|
||||||
constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) {
|
constructor (player: videojs.Player, options?: PeerTubeLinkButtonOptions) {
|
||||||
super(player, options as any)
|
super(player, options as any)
|
||||||
|
@ -17,10 +17,6 @@ class PeerTubeLinkButton extends Button {
|
||||||
this.el().setAttribute('href', this.buildLink())
|
this.el().setAttribute('href', this.buildLink())
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick () {
|
|
||||||
this.player().pause()
|
|
||||||
}
|
|
||||||
|
|
||||||
private buildElement () {
|
private buildElement () {
|
||||||
const el = videojs.dom.createEl('a', {
|
const el = videojs.dom.createEl('a', {
|
||||||
href: this.buildLink(),
|
href: this.buildLink(),
|
||||||
|
@ -31,6 +27,7 @@ class PeerTubeLinkButton extends Button {
|
||||||
})
|
})
|
||||||
|
|
||||||
el.addEventListener('mouseenter', () => this.updateHref())
|
el.addEventListener('mouseenter', () => this.updateHref())
|
||||||
|
el.addEventListener('click', () => this.player().pause())
|
||||||
|
|
||||||
return el as HTMLButtonElement
|
return el as HTMLButtonElement
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ const playerKeys = {
|
||||||
' (muted)': ' (muted)',
|
' (muted)': ' (muted)',
|
||||||
'{1} from servers · {2} from peers': '{1} from servers · {2} from peers',
|
'{1} from servers · {2} from peers': '{1} from servers · {2} from peers',
|
||||||
'Previous video': 'Previous video',
|
'Previous video': 'Previous video',
|
||||||
|
'Video page (new window)': 'Video page (new window)',
|
||||||
'Next video': 'Next video'
|
'Next video': 'Next video'
|
||||||
}
|
}
|
||||||
Object.assign(playerKeys, videojs)
|
Object.assign(playerKeys, videojs)
|
||||||
|
|
Loading…
Reference in New Issue