mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
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:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user