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

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

merged 1 commit into from
Jul 25, 2023

Conversation

adrums86
Copy link
Contributor

@adrums86 adrums86 commented Jul 25, 2023

Description

When creating metadata cues, the last cue uses the videoDuration as the end time, in live playback this is Infinity and throws an error.

Specific Changes proposed

Add an isFinite check to the duration, if it's not finite we use 0 instead.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@adrums86 adrums86 self-assigned this Jul 25, 2023
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #1411 (8acd120) into main (a9ff947) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1411   +/-   ##
=======================================
  Coverage   85.56%   85.56%           
=======================================
  Files          41       41           
  Lines       10146    10147    +1     
  Branches     2352     2353    +1     
=======================================
+ Hits         8681     8682    +1     
  Misses       1465     1465           
Files Changed Coverage Δ
src/util/text-tracks.js 89.47% <100.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@wseymour15 wseymour15 left a comment

Choose a reason for hiding this comment

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

Looks good!

@adrums86 adrums86 merged commit 9723e6d into main Jul 25, 2023
@adrums86 adrums86 deleted the fix_metadata_duration branch July 25, 2023 22:43
@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants