diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-09 23:03:17 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | ad4013d5c3b0e67c453f10962a5b1e3c9b563b74 (patch) | |
tree | 94004d53706c72d8391efe584953d2d10d715eb4 | |
parent | 938abcc6cc4100a217de57b492240c8c54227c04 (diff) | |
download | PeerTube-ad4013d5c3b0e67c453f10962a5b1e3c9b563b74.tar.gz PeerTube-ad4013d5c3b0e67c453f10962a5b1e3c9b563b74.tar.zst PeerTube-ad4013d5c3b0e67c453f10962a5b1e3c9b563b74.zip |
Client: add button control in embed videojs to go to the watch page
-rw-r--r-- | client/src/standalone/videos/embed.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/src/standalone/videos/embed.html b/client/src/standalone/videos/embed.html index cb4ebf2d1..c154e9570 100644 --- a/client/src/standalone/videos/embed.html +++ b/client/src/standalone/videos/embed.html | |||
@@ -34,6 +34,19 @@ | |||
34 | .vjs-poster { | 34 | .vjs-poster { |
35 | background-size: 100% auto; | 35 | background-size: 100% auto; |
36 | } | 36 | } |
37 | |||
38 | .vjs-peertube-link { | ||
39 | color: white; | ||
40 | text-decoration: none; | ||
41 | font-size: 1.3em; | ||
42 | line-height: 2.20; | ||
43 | transition: all .4s; | ||
44 | } | ||
45 | |||
46 | .vjs-peertube-link:hover { | ||
47 | text-shadow: 0 0 1em #fff; | ||
48 | } | ||
49 | |||
37 | </style> | 50 | </style> |
38 | </head> | 51 | </head> |
39 | 52 | ||
@@ -83,6 +96,28 @@ | |||
83 | videojs('video-container', { controls: true, autoplay: false }, function () { | 96 | videojs('video-container', { controls: true, autoplay: false }, function () { |
84 | var player = this | 97 | var player = this |
85 | 98 | ||
99 | var Button = videojs.getComponent('Button') | ||
100 | var peertubeLinkButton = videojs.extend(Button, { | ||
101 | constructor: function () { | ||
102 | Button.apply(this, arguments) | ||
103 | }, | ||
104 | |||
105 | createEl: function () { | ||
106 | var link = document.createElement('a') | ||
107 | link.href = window.location.href.replace('embed', 'watch') | ||
108 | link.innerHTML = 'PeerTube' | ||
109 | link.title = 'Go to the video page' | ||
110 | link.className = 'vjs-peertube-link' | ||
111 | |||
112 | return link | ||
113 | } | ||
114 | }) | ||
115 | videojs.registerComponent('PeerTubeLinkButton', peertubeLinkButton) | ||
116 | |||
117 | var controlBar = player.getChild('controlBar') | ||
118 | var addedLink = controlBar.addChild('PeerTubeLinkButton', {}) | ||
119 | controlBar.el().insertBefore(addedLink.el(), controlBar.fullscreenToggle.el()) | ||
120 | |||
86 | player.dock({ | 121 | player.dock({ |
87 | title: videoInfos.name | 122 | title: videoInfos.name |
88 | }) | 123 | }) |