-
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
Publish an event from DrmEngine if the CDM accepts the license. #1049
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ describe('DrmEngine', function() { | |
var onKeyStatusSpy; | ||
/** @type {!jasmine.Spy} */ | ||
var onExpirationSpy; | ||
/** @type {!jasmine.Spy} */ | ||
var onEventSpy; | ||
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. I created this spy but don't actually use it for anything. Suggestions? 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. I'm not sure we need a separate integration test for this, but you could always expect that onEvent was called at the appropriate time in the "basic flow" test below. Note that DRM integration tests are only run if you use 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. I've left this as is. The new behaviour is already covered by a unit test, and I noticed that |
||
|
||
/** @type {!shaka.media.DrmEngine} */ | ||
var drmEngine; | ||
|
@@ -94,6 +96,7 @@ describe('DrmEngine', function() { | |
onErrorSpy = jasmine.createSpy('onError'); | ||
onKeyStatusSpy = jasmine.createSpy('onKeyStatus'); | ||
onExpirationSpy = jasmine.createSpy('onExpirationUpdated'); | ||
onEventSpy = jasmine.createSpy('onEvent'); | ||
|
||
mediaSource = new MediaSource(); | ||
video.src = window.URL.createObjectURL(mediaSource); | ||
|
@@ -111,10 +114,15 @@ describe('DrmEngine', function() { | |
].join(''); | ||
}); | ||
|
||
drmEngine = new shaka.media.DrmEngine( | ||
networkingEngine, shaka.test.Util.spyFunc(onErrorSpy), | ||
shaka.test.Util.spyFunc(onKeyStatusSpy), | ||
shaka.test.Util.spyFunc(onExpirationSpy)); | ||
var playerInterface = { | ||
netEngine: networkingEngine, | ||
onError: shaka.test.Util.spyFunc(onErrorSpy), | ||
onKeyStatus: shaka.test.Util.spyFunc(onKeyStatusSpy), | ||
onExpirationUpdated: shaka.test.Util.spyFunc(onExpirationSpy), | ||
onEvent: shaka.test.Util.spyFunc(onEventSpy) | ||
}; | ||
|
||
drmEngine = new shaka.media.DrmEngine(playerInterface); | ||
var config = { | ||
retryParameters: shaka.net.NetworkingEngine.defaultRetryParameters(), | ||
clearKeys: {}, | ||
|
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.
Please document this event type in lib/player.js. You'll see several examples toward the top of the file.
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.
Done.