fix(SUP-37490): Align captions with clipTo/SeekFrom Values in PlayManifest #880
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
Move the processing of seekFrom and clipTo from loadMedia() into configure(), where instead of using values from loadMedia mediaOptions arguments, we can use the combined sources config set by merging mediaOptions values with sources config values (which is where the kalturaSeekFrom, kalturaClipTo values from URL are set).
Which means that:
If the values are set ONLY by URL, we use those values to clip captions.
If the values are set ONLY by loadMedia, we use those values.
If a value is set by URL and ALSO by mediaOptions, we prefer the value set by configuration over the value set by mediaOptions (which actually seems to be a bug because it should be the opposite, but this is the current behavior). So for example, kalturaSeekFrom=30 in URL would override the seekFrom value set by loadMedia(..., { seekFrom: 10, clipTo: 50 }).
If one value is set by URL and one is set by mediaOptions
(i.e. inside the page https://...?kalturaSeekFrom=20) we call loadMedia(..., {clipTo: 60}),
we use the combined values {seekFrom: 20, clipTo: 60} together to clip the captions.