From 1a8c2d74d1022cfddc4a12881a4c167ff3eedb3d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 Aug 2020 11:57:38 +0200 Subject: Handle start at/stop at in playlist embed --- client/src/standalone/videos/embed.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'client/src/standalone') diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 786d749a4..f12b8c9ac 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -441,11 +441,13 @@ export class PeerTubeEmbed { controls: this.controls, muted: this.muted, loop: this.loop, + captions: videoCaptions.length !== 0, - startTime: this.startTime, - stopTime: this.stopTime, subtitle: this.subtitle, + startTime: this.playlist ? this.currentPlaylistElement.startTimestamp : this.startTime, + stopTime: this.playlist ? this.currentPlaylistElement.stopTimestamp : this.stopTime, + nextVideo: this.playlist ? () => this.playNextVideo() : undefined, hasNextVideo: this.playlist ? () => !!this.getNextPlaylistElement() : undefined, @@ -506,7 +508,12 @@ export class PeerTubeEmbed { if (this.isPlaylistEmbed()) { await this.buildPlaylistManager() + this.player.playlist().updateSelected() + + this.player.on('stopped', () => { + this.playNextVideo() + }) } } -- cgit v1.2.3