Skip to content
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

handle PermissionRequests in the WebChromeClient #217

Merged

Conversation

adamkobor
Copy link
Contributor

The idea behind this PR is to be capable of handling permission requests coming from the webview on Android. These are vital, if you would like to play DRM protected content inside of it, for example.
The requested resources could be divided into two different groups: the ones where we have a native Android permission as a counterpart, and the ones where we don't.
Where we don't have counterparts (midi sysex messages + protected media), we can use the newly introduced configuration properties inside AndroidWebSettings to automatically grant or deny the requested resources. On the other hand, where we have a counterpart for the requested resource, we check if the desired permission is already granted and if so, then we grant the requested resource too.

What do you think @KevinnZou, would it make sense to have a dedicated section about this new functionality in the README?

@adamkobor adamkobor force-pushed the akobor/allow-protected-media-on-android branch from 07a5e31 to e6761c9 Compare September 4, 2024 12:37
@KevinnZou
Copy link
Owner

@adamkobor Thanks for your contribution! You did a great job! Could you also provide a test sample or a test URL?

@adamkobor
Copy link
Contributor Author

adamkobor commented Sep 9, 2024

@KevinnZou ofc!
I've provided two examples and added a block to the readme too in 3d5f6ec

Midi test page without enabling MIDI sysex messages:
image
Enabled:
image

DRM disabled:
image

DRM enabled:
image

@KevinnZou
Copy link
Owner

@adamkobor Thanks for your contribution. One thing I want to check is whether the iOS side will encounter the same problem. It would be better to make this feature compatible with both platforms.

@adamkobor
Copy link
Contributor Author

adamkobor commented Sep 11, 2024

@adamkobor Thanks for your contribution. One thing I want to check is whether the iOS side will encounter the same problem. It would be better to make this feature compatible with both platforms.

@KevinnZou iOS doesn't have this problem, the EME APIs are enabled there by default, for example. Generally, AFAIK there is no such thing there like the permission requests on Android

@KevinnZou KevinnZou merged commit d6b0e95 into KevinnZou:main Sep 11, 2024
4 checks passed
@adamkobor
Copy link
Contributor Author

@KevinnZou do you have an ETA for the release of this? I'm asking because we're depending on this fix in our production code, and we have to use our own fork in between, but this is far from ideal, so we would like to switch back to your lib as soon as possible :)

@KevinnZou
Copy link
Owner

@adamkobor I have released an alpha version of it, which also updates the CMP version to 1.7.0-beta01. You can use that version first, and I will release the stable version when CMP 1.7.0 is released. Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants