From d8f39b126d9fe4bec1c12fb213548cc6edc87867 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 1 Jun 2023 14:51:16 +0200 Subject: Add storyboard support --- client/src/assets/player/peertube-player-manager.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client/src/assets/player/peertube-player-manager.ts') diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 2781850b9..66d9c7298 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts @@ -6,6 +6,7 @@ import './shared/stats/stats-plugin' import './shared/bezels/bezels-plugin' import './shared/peertube/peertube-plugin' import './shared/resolutions/peertube-resolutions-plugin' +import './shared/control-bar/storyboard-plugin' import './shared/control-bar/next-previous-video-button' import './shared/control-bar/p2p-info-button' import './shared/control-bar/peertube-link-button' @@ -42,6 +43,12 @@ CaptionsButton.prototype.controlText_ = 'Subtitles/CC' // We just want to display 'Off' instead of 'captions off', keep a space so the variable == true (hacky I know) CaptionsButton.prototype.label_ = ' ' +// TODO: remove when https://github.com/videojs/video.js/pull/7598 is merged +const PlayProgressBar = videojs.getComponent('PlayProgressBar') as any +if (PlayProgressBar.prototype.options_.children.includes('timeTooltip') !== true) { + PlayProgressBar.prototype.options_.children.push('timeTooltip') +} + export class PeertubePlayerManager { private static playerElementClassName: string private static playerElementAttributes: { name: string, value: string }[] = [] @@ -135,6 +142,10 @@ export class PeertubePlayerManager { p2pEnabled: options.common.p2pEnabled }) + if (options.common.storyboard) { + player.storyboard(options.common.storyboard) + } + player.on('p2pInfo', (_, data: PlayerNetworkInfo) => { if (data.source !== 'p2p-media-loader' || isNaN(data.bandwidthEstimate)) return -- cgit v1.2.3