-
Notifications
You must be signed in to change notification settings - Fork 72
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: added API to set media keys directly #61
Changes from 1 commit
312b048
3adb995
b93d9c2
1471c5f
fd383d9
4f1109d
bd151fb
fc14190
e79cdff
9c163e9
68d5e2e
a28a2e9
619b03c
e97b895
771cc6b
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 |
---|---|---|
|
@@ -237,6 +237,20 @@ const onPlayerReady = (player) => { | |
const eme = function(options = {}) { | ||
this.eme.options = options; | ||
|
||
this.eme.init = (config) => { | ||
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. We may want to consider a more precise name. Maybe something as direct as |
||
const e = { | ||
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 think we should use a more descriptive variable name. Maybe something like |
||
initDataType: '', | ||
initData: null, | ||
target: this.tech_.el_ | ||
}; | ||
|
||
if (this.tech_.el_.setMediaKeys) { | ||
handleEncryptedEvent(e, config, this.eme.sessions, this.tech_); | ||
} else if (this.tech_.el_.msSetMediaKeys) { | ||
handleMsNeedKeyEvent(e, config, this.eme.sessions, this.tech_); | ||
} | ||
}; | ||
|
||
this.ready(() => onPlayerReady(this)); | ||
}; | ||
|
||
|
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.
This worked for me:
to be clear, I'm trying to avoid an anonymous function being the plugin factory here