Skip to content

Commit

Permalink
fix(player): correctly resolve current chapter index (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
SvyatoslavPozhydaev authored Feb 20, 2024
1 parent d0da0b8 commit 275daa2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class SliderChapters extends Component<SliderChaptersProps, {}, SliderCha
}

private _watchFillPercent() {
let { liveEdge, clipStartTime } = this._media.$state,
let { liveEdge, clipStartTime, duration } = this._media.$state,
{ fillPercent, value } = this._sliderState,
cues = this._$cues(),
isLiveEdge = liveEdge(),
Expand All @@ -157,7 +157,7 @@ export class SliderChapters extends Component<SliderChaptersProps, {}, SliderCha
let currentActiveIndex = isLiveEdge
? this._$cues.length - 1
: this._findActiveChapterIndex(
currentChapter ? (currentChapter.startTime <= peek(value) ? prevActiveIndex : 0) : 0,
currentChapter ? ((currentChapter.startTime / duration() * 100) <= peek(value) ? prevActiveIndex : 0) : 0,
fillPercent(),
);

Expand Down

0 comments on commit 275daa2

Please sign in to comment.