diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index f5abc652b9..efad883f20 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -1580,20 +1580,14 @@ import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../../components const item = currentItem; // use markers based on chapters - if (item && item.Chapters && item.Chapters.length) { - const runtimeDuration = item.RunTimeTicks; - - for (let i = 0, length = item.Chapters.length; i < length; i++) { - const currentChapter = item.Chapters[i]; - - const fraction = currentChapter.StartPositionTicks / runtimeDuration; - + if (item?.Chapters?.length) { + item.Chapters.forEach(currentChapter => { markers.push({ className: 'chapterMarker', name: currentChapter.Name, - progress: fraction + progress: currentChapter.StartPositionTicks / item.RunTimeTicks }); - } + }); } return markers;