return;
isSessionCreated = true;
- video.mediaKeys.createSession(event.contentType, event.initData).then(function(mediaKeySession) {
- waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
- }).catch(function(error) {
+ var mediaKeySession = video.mediaKeys.createSession();
+ waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
+ mediaKeySession.generateRequest(event.contentType, event.initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
- video.setMediaKeys(mediaKeys);
+ return video.setMediaKeys(mediaKeys);
+ }).then(function(result) {
video.src = '../content/test-encrypted.webm';
video.play();
}).catch(function(error) {