aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-player-manager.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-04-12 10:26:30 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-04-28 09:05:44 +0200
commitff563914bb10728301a24fb9e548c9efb62387eb (patch)
treec998ad721f134404d3510cff2906e88ea03d8301 /client/src/assets/player/peertube-player-manager.ts
parent0979075453b380fa8e3694db3f460e822f046c35 (diff)
downloadPeerTube-ff563914bb10728301a24fb9e548c9efb62387eb.tar.gz
PeerTube-ff563914bb10728301a24fb9e548c9efb62387eb.tar.zst
PeerTube-ff563914bb10728301a24fb9e548c9efb62387eb.zip
add stats videojs plugin
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r--client/src/assets/player/peertube-player-manager.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index ed82e0496..62dff8285 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -4,6 +4,8 @@ import 'videojs-contextmenu-pt'
4import 'videojs-contrib-quality-levels' 4import 'videojs-contrib-quality-levels'
5import './upnext/end-card' 5import './upnext/end-card'
6import './upnext/upnext-plugin' 6import './upnext/upnext-plugin'
7import './stats/stats-card'
8import './stats/stats-plugin'
7import './bezels/bezels-plugin' 9import './bezels/bezels-plugin'
8import './peertube-plugin' 10import './peertube-plugin'
9import './videojs-components/next-previous-video-button' 11import './videojs-components/next-previous-video-button'
@@ -170,6 +172,11 @@ export class PeertubePlayerManager {
170 self.addContextMenu(mode, player, options.common.embedUrl, options.common.embedTitle) 172 self.addContextMenu(mode, player, options.common.embedUrl, options.common.embedTitle)
171 173
172 player.bezels() 174 player.bezels()
175 player.stats({
176 videoUUID: options.common.videoUUID,
177 videoIsLive: options.common.isLive,
178 mode
179 })
173 180
174 return res(player) 181 return res(player)
175 }) 182 })
@@ -538,6 +545,14 @@ export class PeertubePlayerManager {
538 }) 545 })
539 } 546 }
540 547
548 items.push({
549 icon: 'info',
550 label: player.localize('Stats for nerds'),
551 listener: () => {
552 player.stats().show()
553 }
554 })
555
541 return items.map(i => ({ 556 return items.map(i => ({
542 ...i, 557 ...i,
543 label: `<span class="vjs-icon-${i.icon || 'link-2'}"></span>` + i.label 558 label: `<span class="vjs-icon-${i.icon || 'link-2'}"></span>` + i.label