-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix: support check persistent-license to remove the mediakeysession #7050
base: master
Are you sure you want to change the base?
Conversation
return mediaKeysSession | ||
.remove() | ||
const { drmSystemOptions } = this.config; | ||
const removePromise = isPersistentSessionType(drmSystemOptions) |
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.
If we don't want to check this, we can also try using a config like disableMediaKeySessionRemove
to skip this. Any ideas?
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.
What would making this configurable solve?
There are many cases where removeSession
is called. It makes sense to leave persistent sessions active in the happy path, but it might not in all the places where removeSession
is called - like when cleaning up after a fatal error.
Would a callback function that accepts the key session context and removal conditions and returns whether or not to dispose of the key session work?
Something like:
removeMediaKeySessionFunc: (
keyContext: MediaKeySessionContext,
reasonForRemoval: 'key-renewal' | 'license-release' | 'destroy' | 'error' | <other message?>,
)
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.
Does this PR resolve #6806, or is additional work needed to unblock removeSession
(like wrapping it in a timeout or additional error handling for mediaKeySession.remove
)?
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.
Hi @JackPu,
Can you respond to these comments?
- Should we follow up on these changes by passing in EME "message" Event
messageType
toremoveSession
(or Error/Event itself), because in some cases the persistent session should still be removed? - Do we still need to catch or timeout the
removeSession
promises inCDMCleanupPromise
for LongEMEController. destroy
block the next time setMediaKeys #6806?
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.
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.
Should we follow up on these changes by passing in EME "message" Event messageType to removeSession (or Error/Event itself), because in some cases the persistent session should still be removed?
I think we may need this if we haven't any better solution.
Do we still need to catch or timeout the removeSession promises in CDMCleanupPromise
I think adding this is a good feature to catch the other cases. As you mentioned you can add additional error handling for this. In fact, I only met the issue on a small OTT platform, I am not sure If it is worth doing 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.
I can merge this firstly until we find some other rereuirements for improve the condition of removeSession
I will fix the unit tests later |
Waiting for a response to the comments above.
This PR will...
It will check if the session type is
persistent-license
and then make the decision to executemediakeySession.remove
.Why is this Pull Request needed?
I mentioned the issue here: #6806
We have found the issue on the Samsung and Comcast platforms. It seems we cannot resolve the method mediaKeySession.remove(). Because we cannot close the media session, it will cause the next time session request. It will throw an error like this
Are there any points in the code the reviewer needs to double check?
Resolves issues:
Checklist