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.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/client/src/assets/player/peertube-link-button.ts b/client/src/assets/player/peertube-link-button.ts
new file mode 100644
index 000000000..6ead78c00
--- /dev/null
+++ b/client/src/assets/player/peertube-link-button.ts
@@ -0,0 +1,20 @@
1import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
2
3const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
4class PeerTubeLinkButton extends Button {
5
6 createEl () {
7 return videojsUntyped.dom.createEl('a', {
8 href: window.location.href.replace('embed', 'watch'),
9 innerHTML: 'PeerTube',
10 title: 'Go to the video page',
11 className: 'vjs-peertube-link',
12 target: '_blank'
13 })
14 }
15
16 handleClick () {
17 this.player_.pause()
18 }
19}
20Button.registerComponent('PeerTubeLinkButton', PeerTubeLinkButton)