Sort chapters arr when switching to prev/next one

TOC representation obtained for some video files might be out of order. Sort them when switching between chapers, otherwise "next" chapter might not be the nearest one.
This commit is contained in:
Rafał Dzięgiel
2021-04-22 15:48:16 +02:00
parent 6b5240ddbc
commit 32995fc6a6

View File

@@ -429,7 +429,7 @@ class ClapperPlayer extends GstClapper.Clapper
return false;
const now = this.position / Gst.SECOND;
const chapterTimes = Object.keys(chapters);
const chapterTimes = Object.keys(chapters).sort((a, b) => a - b);
if(isPrevious)
chapterTimes.reverse();