fix(FEC-10963): filter duplicate captions #547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Changes
When vtt file is sliced it sometimes may contain same caption line in both slices of the vtt file as the time range of it is crossing the slicing border.
If the line has a trailing whitespace it will be treated differently if it is in the end of the vtt slice or at the start(or middle) as we trim the entire vtt fragment we get but not the individual time blocks.
Example:
In the first fragment we will clip the trailing whitespace cause we do it in webvtt-parser for the entire frag before we start line by line processing.
In the second fragment we won't clip it as it is in the middle of the string.
The end result is that we will create a different hash for each of these lines, and then they will appear duplicate.
Solution is to just clip each cue text as well.
Please note - this is a workaround until we land the fix we did in hls.js itslef and then we will remove this.
Solves FEC-10963.
Related to FEC-11048.
CheckLists