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

feat: support in-manifest DRM data #60

Merged
merged 10 commits into from
Mar 30, 2018
Merged

feat: support in-manifest DRM data #60

merged 10 commits into from
Mar 30, 2018

Conversation

forbesjo
Copy link
Contributor

@forbesjo forbesjo commented Mar 20, 2018

Description

Added support for detecting in-manifest DRM data.

Requirements Checklist

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

@@ -168,11 +175,11 @@ const setupEmeOptions = (hlsHandler) => {
const player = videojs.players[hlsHandler.tech_.options_.playerId];

if (player.eme) {
player.eme.options = videojs.mergeOptions(player.eme.options, emeOptions(
player.eme.options = emeOptions(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this because of the following scenario: given a playlist with two DRM sources, the first has in-manifest DRM info and the second does not, the first source's data would carry over into the second and prevent playback.

Copy link
Contributor Author

@forbesjo forbesjo Mar 28, 2018

Choose a reason for hiding this comment

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

In the long term we'll look into making contrib-eme a middleware

Copy link
Contributor

Choose a reason for hiding this comment

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

I know we discussed the possibility of removing player.eme.options entirely, and I think we should go through with that on a major version of videojs-contrib-eme. However, I think we should be careful about completely replacing player.eme.options right now. With this behavior if someone had used the top level eme plugin options, they will all be overwritten. I think instead we should find a way to pass along the new options from VHS as part of the source. Maybe via modifying the source object itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The source options merge with the plugin options in contrib-eme so it would behave the same way it was before where we merge them here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead I'll default pssh: '' and do the merge

@@ -146,9 +146,17 @@ const emeOptions = (keySystemOptions, videoPlaylist, audioPlaylist) => {
for (let keySystem in keySystemOptions) {
keySystemContentTypes[keySystem] = {
audioContentType: `audio/mp4; codecs="${audioPlaylist.attributes.CODECS}"`,
videoContentType: `video/mp4; codecs="${videoPlaylist.attributes.CODECS}"`
videoContentType: `video/mp4; codecs="${videoPlaylist.attributes.CODECS}"`,
pssh: ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we still want to default to an empty string for pssh now that we're overwriting the source options?

));
);

player.currentSource().keySystems = sourceOptions.keySystems;
Copy link
Contributor

Choose a reason for hiding this comment

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

This throws an error if hlsHandler.source_.keySystem is undefined. Might be good for us to check sourceOptions and add a test for the case where no keySystems options are passed. The emeOptions function can also return the keySystems on their own now (and we can probably rename the function to emeKeySystems, or something like that, if we want).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 will make some updates

}, 'set source eme options');
});

QUnit.test('ignores configures eme if not provided by source', function(assert) {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: should probably read something like "does not set source keySystems if keySystems not provided by source"

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.

2 participants