mozilla/geckoview

Enabling DRM content

marco-elia opened this issue · 3 comments

Hi, I was trying to reproduce some DRM content in geckoview, I have seen that probably must be used GeckoSession.PermissionDelegate to manage DRM, but I don't really understand how to use it.

I managed to get something with something like this
session2.permissionDelegate = MyPermissionDelegate()

class MyPermissionDelegate : GeckoSession.PermissionDelegate {
override fun onContentPermissionRequest(
session: GeckoSession,
perm: GeckoSession.PermissionDelegate.ContentPermission
): GeckoResult<Int>? {
if ( perm.permission == GeckoSession.PermissionDelegate.PERMISSION_MEDIA_KEY_SYSTEM_ACCESS){
return GeckoResult.fromValue(GeckoSession.PermissionDelegate.ContentPermission.VALUE_ALLOW)
}
return super.onContentPermissionRequest(session, perm)
}
}

But I'm quite sure is not the proper way to do this.

If your intention is to auto-allow DRM content permissions for the user, then yes, this way works.

Ok, thank you very much!