aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-link-button.ts
blob: 6ead78c006c424f1d0be115bae8a2285d687b46c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'

const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
class PeerTubeLinkButton extends Button {

  createEl () {
    return videojsUntyped.dom.createEl('a', {
      href: window.location.href.replace('embed', 'watch'),
      innerHTML: 'PeerTube',
      title: 'Go to the video page',
      className: 'vjs-peertube-link',
      target: '_blank'
    })
  }

  handleClick () {
    this.player_.pause()
  }
}
Button.registerComponent('PeerTubeLinkButton', PeerTubeLinkButton)