aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-link-button.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/peertube-link-button.ts')
-rw-r--r--client/src/assets/player/peertube-link-button.ts40
1 files changed, 0 insertions, 40 deletions
diff --git a/client/src/assets/player/peertube-link-button.ts b/client/src/assets/player/peertube-link-button.ts
deleted file mode 100644
index de9a49de9..000000000
--- a/client/src/assets/player/peertube-link-button.ts
+++ /dev/null
@@ -1,40 +0,0 @@
1import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
2import { buildVideoLink } from './utils'
3// FIXME: something weird with our path definition in tsconfig and typings
4// @ts-ignore
5import { Player } from 'video.js'
6
7const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
8class PeerTubeLinkButton extends Button {
9
10 constructor (player: Player, options: any) {
11 super(player, options)
12 }
13
14 createEl () {
15 return this.buildElement()
16 }
17
18 updateHref () {
19 this.el().setAttribute('href', buildVideoLink(this.player().currentTime()))
20 }
21
22 handleClick () {
23 this.player_.pause()
24 }
25
26 private buildElement () {
27 const el = videojsUntyped.dom.createEl('a', {
28 href: buildVideoLink(),
29 innerHTML: 'PeerTube',
30 title: this.player_.localize('Go to the video page'),
31 className: 'vjs-peertube-link',
32 target: '_blank'
33 })
34
35 el.addEventListener('mouseenter', () => this.updateHref())
36
37 return el
38 }
39}
40Button.registerComponent('PeerTubeLinkButton', PeerTubeLinkButton)