Calin
Calin

Reputation: 6867

Android webview drm content playback

I am trying to play some drm content in a webview on android TV, according to https://bugs.chromium.org/p/chromium/issues/detail?id=526058 I need to grant RESOURCE_PROTECTED_MEDIA_ID so in a class inheriting WebChromeClient I have:

class CustomWebChromeClient : WebChromeClient() {
    // https://bugs.chromium.org/p/chromium/issues/detail?id=526058
    override fun onPermissionRequest(request: PermissionRequest?) {
        super.onPermissionRequest(request)

        Handler().post({
            request?.grant(arrayOf(RESOURCE_PROTECTED_MEDIA_ID))
        })
    }
}

When I run this I get an error grant or deny was already requested.

I don't see the permission in the app details nor was I asked to grant this permission to the app why am I getting this error?

Upvotes: 1

Views: 1511

Answers (1)

Calin
Calin

Reputation: 6867

The solution was as simple as not calling super.

It turns out that super will by default deny all requests.

Upvotes: 1

Related Questions