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

Save session-specific options in pending session data when waiting on media keys #96

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

gesinger
Copy link
Contributor

Instead of always using new options, persist options passed when adding session data to the pendingSessionData array to allow for different options per session created.

This fixes cases where two encrypted pieces of media are in the same manifest, and a user set up the sessions in advance using initializeMediaKeys. Previously, the newest options would be used for all sessions. This provides the relevant options.

Testing

Because this case occurs when the same manifest has content with different keys, finding a source for testing is a bit of a challenge. I was able to combine two clear key encrypted sources into one manifest using https://github.com/gesinger/encrypted-video-creator, and can share the instructions/content, but the general steps are:

  1. Run the script using default options on a source two times (with different destinations)
  2. Combine the audio/video stream manifests, adding an EXT-X-DISCONTINUITY tag in-between where one media ends and the other begins
  3. Combine the sample-code.js files by copying the keys array over as keys2 (or some more appropriate name), and the getLicense function as getLicense2, then initializeMediaKeys separately for each

… media keys

Instead of always using new options, persist options passed when adding
session data to the pendingSessionData array to allow for different
options per session created.
Copy link
Contributor

@alex-barstow alex-barstow left a comment

Choose a reason for hiding this comment

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

LGTM

@gesinger gesinger merged commit 6cdbfa8 into videojs:master Feb 7, 2020
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.

None yet

2 participants