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

Implement EXT-X-DEFINE Variable Substitution #5161

Merged
merged 5 commits into from
Jan 20, 2023

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jan 15, 2023

This PR will...

  • Implement EXT-X-DEFINE Variable Substitution
    • Conditionally compile out Variable Substitution from hls.light build
    • Adds another ErrorDetails.MANIFEST_PARSING_ERROR event for duplicate variable definitions in Multi-Variant Playlists
    • Adds new ErrorDetails.LEVEL_PARSING_ERROR events for duplicate variable definitions and invalid variable imports in Media Playlists
    • Emits parsing error when finding Variable Reference whose Variable Name has NOT been provided
  • Add support EXT-X-START in Multi-Variant Playlist (supersedes offsets in Media Playlists)
  • Add Content-Steering Multi-Variant Playlist parsing (Work-in-progress: Add support for Content Steering and Variable Substitution #5074)

Why is this Pull Request needed?

Variable Substitution is commonly paired with Content-Steering. So having full support for EXT-X-DEFINE is a prerequisite.

I noticed the player was missing support for EXT-X-START time offset in Multi-Variant Playlists so included that.

Are there any points in the code the reviewer needs to double check?

If you are using these features in other players please try them in HLS.js.

The playlist parser traditionally only errored when missing variants or missing segments. The parser continues to parse after encountering these errors so that the complete parsed results are returned regardless. This is also done to avoid any de-optimizations in wrapping parsing in try-catch block(s).

Multivariable Playlist parsing errors are always fatal, ending the loading session. Media Playlist errors are non-fatal when another variant can be selected; the player will attempt to switch levels (same behavior as FRAG_PARSING_ERROR).

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.4.0 milestone Jan 15, 2023
@robwalch robwalch force-pushed the feature/variable-substitution branch from 1732b64 to d27af44 Compare January 15, 2023 05:57
@robwalch robwalch force-pushed the feature/variable-substitution branch 2 times, most recently from 95184bc to a0d75e7 Compare January 18, 2023 22:38
@robwalch robwalch force-pushed the feature/variable-substitution branch from a0d75e7 to f1996ef Compare January 18, 2023 22:55
@robwalch robwalch merged commit 6f6fa2e into master Jan 20, 2023
@robwalch robwalch deleted the feature/variable-substitution branch January 20, 2023 00:52
robwalch added a commit that referenced this pull request Jan 26, 2023
* Implement EXT-X-DEFINE Variable Substitution
Add support EXT-X-START in Multi-Variant Playlist
Add Content-Steering Multi-Variant Playlist parsing (#5074)

* Return parse error on undefined Variable Reference
Only track/return first parse error
Fix typos

* Use same error handling as FRAG_PARSING_ERROR for LEVEL_PARSING_ERROR

* Minor improvements to esdocs generated docs

* Use logical assignment on playlistParsingError

Co-authored-by: Rob Walch <rob@jwplayer.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant