-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Some DRM providers require default KID in wrapped license requests #529
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fd38a06
Include default KID in drm info struct as some DRM providers require …
birme 42fa9d9
Make defaultKID default to null
birme aa693af
Make defaultKID default to null
birme 68f36ab
Updated authors and contributors files
birme b9d76e3
Keep list alphabetized
birme 72dba5c
Correction based on feedback for PR to handle multiple key IDs in a s…
birme de005a6
Renaming variable defaultKeys to keyIds for consistency
birme b4b0410
Updated unit test for drmInfo struct to include keyIds
birme f5f0d47
Fixed line to long error
birme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -429,6 +429,13 @@ shaka.media.DrmEngine.prototype.prepareMediaKeyConfigs_ = | |
fullMimeType += '; codecs="' + stream.codecs + '"'; | ||
} | ||
|
||
// Some DRM license providers requires that we have a default | ||
// KID from manifest in the wrapped license request | ||
// and needs to be accessible in a request filter | ||
if (stream.keyId) { | ||
drmInfo.keyIds.push(stream.keyId); | ||
} | ||
|
||
// Edge 13 fails this negotiation with NotSupportedError if more than | ||
// one entry is given, even if each entry individually would be | ||
// supported. Bug filed: https://goo.gl/vr2Vle | ||
|
@@ -585,6 +592,10 @@ shaka.media.DrmEngine.prototype.fillInDrmInfoDefaults_ = function(drmInfo) { | |
} | ||
} | ||
|
||
if (!drmInfo.keyIds) { | ||
drmInfo.keyIds = []; | ||
} | ||
|
||
var advanced = this.config_.advanced[keySystem]; | ||
if (advanced) { | ||
if (!drmInfo.distinctiveIdentifierRequired) { | ||
|
@@ -660,7 +671,8 @@ shaka.media.DrmEngine.prototype.configureClearKey_ = function() { | |
audioRobustness: '', | ||
videoRobustness: '', | ||
serverCertificate: null, | ||
initData: initDatas | ||
initData: initDatas, | ||
keyIds: [] | ||
}; | ||
}; | ||
|
||
|
@@ -685,7 +697,11 @@ shaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function( | |
/** @type {!Array.<!shakaExtern.InitDataOverride>} */ | ||
var initDatas = []; | ||
|
||
this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas); | ||
/** @type {!Array.<!string>} */ | ||
var defaultKeys = []; | ||
|
||
this.processDrmInfos_(drmInfos, licenseServers, serverCerts, initDatas, | ||
defaultKeys); | ||
|
||
if (serverCerts.length > 1) { | ||
shaka.log.warning('Multiple unique server certificates found! ' + | ||
|
@@ -710,7 +726,8 @@ shaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function( | |
audioRobustness: audioRobustness, | ||
videoRobustness: videoRobustness, | ||
serverCertificate: serverCerts[0], | ||
initData: initDatas | ||
initData: initDatas, | ||
keyIds: defaultKeys | ||
}; | ||
}; | ||
|
||
|
@@ -723,10 +740,11 @@ shaka.media.DrmEngine.prototype.createCurrentDrmInfo_ = function( | |
* @param {!Array.<string>} licenseServers | ||
* @param {!Array.<!Uint8Array>} serverCerts | ||
* @param {!Array.<!shakaExtern.InitDataOverride>} initDatas | ||
* @param {!Array.<string>} defaultKeys | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency, let's give this the same name as the structure member: keyIds. |
||
* @private | ||
*/ | ||
shaka.media.DrmEngine.prototype.processDrmInfos_ = | ||
function(drmInfos, licenseServers, serverCerts, initDatas) { | ||
function(drmInfos, licenseServers, serverCerts, initDatas, defaultKeys) { | ||
/** | ||
* @param {shakaExtern.InitDataOverride} a | ||
* @param {shakaExtern.InitDataOverride} b | ||
|
@@ -764,6 +782,14 @@ shaka.media.DrmEngine.prototype.processDrmInfos_ = | |
} | ||
}); | ||
} | ||
|
||
if (drmInfo.keyIds) { | ||
for (var i = 0; i < drmInfo.keyIds.length; ++i) { | ||
if (defaultKeys.indexOf(drmInfo.keyIds[i]) == -1) { | ||
defaultKeys.push(drmInfo.keyIds[i]); | ||
} | ||
} | ||
} | ||
}); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings are non-nullable by default, so you can just say
!Array.<string>