diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-30 17:40:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-03 14:02:10 +0200 |
commit | c6352f2c64f3c1ad54f8500f493587cdce3d33c9 (patch) | |
tree | 642a5b29b4d68ed8915e5e800232eab069303f79 /client/src/assets/player/peertube-link-button.ts | |
parent | 6b9af1293621a81564296ead6f12f5e70eafbca2 (diff) | |
download | PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.tar.gz PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.tar.zst PeerTube-c6352f2c64f3c1ad54f8500f493587cdce3d33c9.zip |
Improve player
Add a settings dialog based on the work of Yanko Shterev (@yshterev):
https://github.com/yshterev/videojs-settings-menu. Thanks!
Diffstat (limited to 'client/src/assets/player/peertube-link-button.ts')
-rw-r--r-- | client/src/assets/player/peertube-link-button.ts | 20 |
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 @@ | |||
1 | import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' | ||
2 | |||
3 | const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button') | ||
4 | class 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 | } | ||
20 | Button.registerComponent('PeerTubeLinkButton', PeerTubeLinkButton) | ||