Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(live): cue end time not finite #1411

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/util/text-tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ export const addMetadata = ({
// Map each cue group's endTime to the next group's startTime
sortedStartTimes.forEach((startTime, idx) => {
const cueGroup = cuesGroupedByStartTime[startTime];
const nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for commenting on merged PR, but maybe we should consider endTime= startTime instead of 0 in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Just saw a link to this from another issue. Will put up a quick PR for that fix, I agree start time is more appropriate.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry to comment this, but when the endTime is set to the starttime or "0".... the cue doesn't get active anymore.

const finiteDuration = isFinite(videoDuration) ? videoDuration : 0;
const nextTime = Number(sortedStartTimes[idx + 1]) || finiteDuration;

// Map each cue's endTime the next group's startTime
cueGroup.forEach((cue) => {
Expand Down