diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-04-12 10:26:30 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-04-28 09:05:44 +0200 |
commit | ff563914bb10728301a24fb9e548c9efb62387eb (patch) | |
tree | c998ad721f134404d3510cff2906e88ea03d8301 /client/src/assets/player/peertube-player-manager.ts | |
parent | 0979075453b380fa8e3694db3f460e822f046c35 (diff) | |
download | PeerTube-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.ts | 15 |
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' | |||
4 | import 'videojs-contrib-quality-levels' | 4 | import 'videojs-contrib-quality-levels' |
5 | import './upnext/end-card' | 5 | import './upnext/end-card' |
6 | import './upnext/upnext-plugin' | 6 | import './upnext/upnext-plugin' |
7 | import './stats/stats-card' | ||
8 | import './stats/stats-plugin' | ||
7 | import './bezels/bezels-plugin' | 9 | import './bezels/bezels-plugin' |
8 | import './peertube-plugin' | 10 | import './peertube-plugin' |
9 | import './videojs-components/next-previous-video-button' | 11 | import './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 |