diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-19 21:34:45 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-19 21:34:45 +0100 |
commit | 1dc240a9488c66ad38205d08fcfdb32d35efceaa (patch) | |
tree | f97f41e367c52eaf55568f0d0cabf5c8444b86a4 /client/src/assets/player/peertube-player-manager.ts | |
parent | c5c09c1e5017844027ef77785f2d0406fa6b7039 (diff) | |
download | PeerTube-1dc240a9488c66ad38205d08fcfdb32d35efceaa.tar.gz PeerTube-1dc240a9488c66ad38205d08fcfdb32d35efceaa.tar.zst PeerTube-1dc240a9488c66ad38205d08fcfdb32d35efceaa.zip |
Add next video button to the player
Diffstat (limited to 'client/src/assets/player/peertube-player-manager.ts')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 276f9ec59..d9e02cd7d 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -8,6 +8,7 @@ import 'videojs-contrib-quality-levels' | |||
8 | import './upnext/upnext-plugin' | 8 | import './upnext/upnext-plugin' |
9 | import './bezels/bezels-plugin' | 9 | import './bezels/bezels-plugin' |
10 | import './peertube-plugin' | 10 | import './peertube-plugin' |
11 | import './videojs-components/next-video-button' | ||
11 | import './videojs-components/peertube-link-button' | 12 | import './videojs-components/peertube-link-button' |
12 | import './videojs-components/resolution-menu-button' | 13 | import './videojs-components/resolution-menu-button' |
13 | import './videojs-components/settings-menu-button' | 14 | import './videojs-components/settings-menu-button' |
@@ -62,6 +63,7 @@ export interface CommonOptions extends CustomizationOptions { | |||
62 | onPlayerElementChange: (element: HTMLVideoElement) => void | 63 | onPlayerElementChange: (element: HTMLVideoElement) => void |
63 | 64 | ||
64 | autoplay: boolean | 65 | autoplay: boolean |
66 | nextVideo?: Function | ||
65 | videoDuration: number | 67 | videoDuration: number |
66 | enableHotkeys: boolean | 68 | enableHotkeys: boolean |
67 | inactivityTimeout: number | 69 | inactivityTimeout: number |
@@ -233,7 +235,8 @@ export class PeertubePlayerManager { | |||
233 | children: this.getControlBarChildren(mode, { | 235 | children: this.getControlBarChildren(mode, { |
234 | captions: commonOptions.captions, | 236 | captions: commonOptions.captions, |
235 | peertubeLink: commonOptions.peertubeLink, | 237 | peertubeLink: commonOptions.peertubeLink, |
236 | theaterButton: commonOptions.theaterButton | 238 | theaterButton: commonOptions.theaterButton, |
239 | nextVideo: commonOptions.nextVideo | ||
237 | }) | 240 | }) |
238 | } | 241 | } |
239 | } | 242 | } |
@@ -329,7 +332,8 @@ export class PeertubePlayerManager { | |||
329 | private static getControlBarChildren (mode: PlayerMode, options: { | 332 | private static getControlBarChildren (mode: PlayerMode, options: { |
330 | peertubeLink: boolean | 333 | peertubeLink: boolean |
331 | theaterButton: boolean, | 334 | theaterButton: boolean, |
332 | captions: boolean | 335 | captions: boolean, |
336 | nextVideo?: Function | ||
333 | }) { | 337 | }) { |
334 | const settingEntries = [] | 338 | const settingEntries = [] |
335 | const loadProgressBar = mode === 'webtorrent' ? 'peerTubeLoadProgressBar' : 'loadProgressBar' | 339 | const loadProgressBar = mode === 'webtorrent' ? 'peerTubeLoadProgressBar' : 'loadProgressBar' |
@@ -340,7 +344,18 @@ export class PeertubePlayerManager { | |||
340 | settingEntries.push('resolutionMenuButton') | 344 | settingEntries.push('resolutionMenuButton') |
341 | 345 | ||
342 | const children = { | 346 | const children = { |
343 | 'playToggle': {}, | 347 | 'playToggle': {} |
348 | } | ||
349 | |||
350 | if (options.nextVideo) { | ||
351 | Object.assign(children, { | ||
352 | 'nextVideoButton': { | ||
353 | handler: options.nextVideo | ||
354 | } | ||
355 | }) | ||
356 | } | ||
357 | |||
358 | Object.assign(children, { | ||
344 | 'currentTimeDisplay': {}, | 359 | 'currentTimeDisplay': {}, |
345 | 'timeDivider': {}, | 360 | 'timeDivider': {}, |
346 | 'durationDisplay': {}, | 361 | 'durationDisplay': {}, |
@@ -370,7 +385,7 @@ export class PeertubePlayerManager { | |||
370 | }, | 385 | }, |
371 | entries: settingEntries | 386 | entries: settingEntries |
372 | } | 387 | } |
373 | } | 388 | }) |
374 | 389 | ||
375 | if (options.peertubeLink === true) { | 390 | if (options.peertubeLink === true) { |
376 | Object.assign(children, { | 391 | Object.assign(children, { |