X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-watch%2Fvideo-watch-playlist.component.ts;h=0a4d6bfd11c66d2dd6a9e0852a28a182b332e167;hb=b1ed448e948211a59ab110c9d4c7c2e82819645e;hp=a70167da519e8642b3eabb3ef7ae0a23f8800ef7;hpb=fd78d2e247b014fd1561cfb5206c9b8b14d6b820;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts index a70167da5..0a4d6bfd1 100644 --- a/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch-playlist.component.ts @@ -118,6 +118,9 @@ export class VideoWatchPlaylistComponent { updatePlaylistIndex (position: number) { if (this.playlistElements.length === 0 || !position) return + // Handle the reverse index + if (position < 0) position = this.playlist.videosLength + position + 1 + for (const playlistElement of this.playlistElements) { // >= if the previous videos were not valid if (playlistElement.video && playlistElement.position >= position) {