diff --git a/AUTHORS b/AUTHORS index 989b7fbcf8..2ced75e56f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -66,6 +66,7 @@ Prakash Robert Colantuoni Robert Galluccio Rodolphe Breton +Rohan Gupta Roi Lipman Roksolana Ivanyshyn Rostislav Hejduk diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2320062f86..166c0ce03b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -98,6 +98,7 @@ Robert Colantuoni Robert Galluccio Rodolphe Breton Rohit Makasana +Rohan Gupta Roi Lipman Roksolana Ivanyshyn Rostislav Hejduk diff --git a/lib/player.js b/lib/player.js index a7a25b296e..6fd29a16b3 100644 --- a/lib/player.js +++ b/lib/player.js @@ -4330,6 +4330,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget { return []; } const chapters = []; + const uniqueChapters = new Set(); for (const chaptersTrack of chaptersTracksWithLanguage) { if (chaptersTrack && chaptersTrack.cues) { for (const cue of chaptersTrack.cues) { @@ -4344,7 +4345,10 @@ shaka.Player = class extends shaka.util.FakeEventTarget { startTime: cue.startTime, endTime: cue.endTime, }; - chapters.push(chapter); + if (!uniqueChapters.has(id)) { + chapters.push(chapter); + uniqueChapters.add(id); + } } } }