diff options
Diffstat (limited to 'client/src/standalone')
-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 | }) |