Skip to content

Commit 7f58290

Browse files
authored
Merge pull request Dash-Industry-Forum#2846 from Orange-OpenSource/fixClearKeyRegression
ClearKey regression fix
2 parents 418907c + ab50824 commit 7f58290

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/streaming/protection/models/ProtectionModel_21Jan2015.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,14 @@ function ProtectionModel_21Jan2015(config) {
206206
// Generate initial key request.
207207
// keyids type is used for clearkey when keys are provided directly in the protection data and then request to a license server is not needed
208208
const dataType = ks.systemString === ProtectionConstants.CLEARKEY_KEYSTEM_STRING && protData && protData.clearkeys ? 'keyids' : 'cenc';
209-
if (initData.constructor === Uint8Array) {
210-
session.generateRequest(dataType, initData).then(function () {
211-
logger.debug('DRM: Session created. SessionID = ' + sessionToken.getSessionID());
212-
eventBus.trigger(events.KEY_SESSION_CREATED, {data: sessionToken});
213-
}).catch(function (error) {
214-
// TODO: Better error string
215-
removeSession(sessionToken);
216-
eventBus.trigger(events.KEY_SESSION_CREATED, {data: null, error: new DashJSError(ProtectionErrors.KEY_SESSION_CREATED_ERROR_CODE, ProtectionErrors.KEY_SESSION_CREATED_ERROR_MESSAGE + 'Error generating key request -- ' + error.name)});
217-
});
218-
}
209+
session.generateRequest(dataType, initData).then(function () {
210+
logger.debug('DRM: Session created. SessionID = ' + sessionToken.getSessionID());
211+
eventBus.trigger(events.KEY_SESSION_CREATED, {data: sessionToken});
212+
}).catch(function (error) {
213+
// TODO: Better error string
214+
removeSession(sessionToken);
215+
eventBus.trigger(events.KEY_SESSION_CREATED, {data: null, error: new DashJSError(ProtectionErrors.KEY_SESSION_CREATED_ERROR_CODE, ProtectionErrors.KEY_SESSION_CREATED_ERROR_MESSAGE + 'Error generating key request -- ' + error.name)});
216+
});
219217
}
220218

221219
function updateKeySession(sessionToken, message) {

0 commit comments

Comments
 (0)