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

support media projection feature for android 14 #1552

Conversation

Jaemin-VIRNECT
Copy link
Contributor

After AOS 14, changeCaptureFormat() should resize the VirtualDisplay instead of recreating it due to the limitation on reusing MediaProjectionPermissionResultData. And it is necessary to obtain capture permission first and request foreground service; otherwise, the app crashes due to the media projection permission policy.
Use Helper.requestCapturePermission() to obtain capture permission on Android 14 specially targetSdkVersion 34 or above.

Tested on Android 13, 14 and targetSdkVersion 33, 34 combinations.

…instead of recreating it due to the limitation on reusing MediaProjectionPermissionResultData. And it is necessary to obtain capture permission first and request foreground service; otherwise, the app crashes due to the media projection permission policy.

Use Helper.requestCapturePermission() to obtain capture permission on Android 14 specially targetSdk 34 or above.
Copy link
Member

@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cloudwebrtc cloudwebrtc merged commit 3871348 into flutter-webrtc:main Apr 8, 2024
7 checks passed
VladimirBrejcha pushed a commit to sergeynekrasov8430/flutter-webrtc that referenced this pull request Apr 27, 2024
…instead of recreating it due to the limitation on reusing MediaProjectionPermissionResultData. And it is necessary to obtain capture permission first and request foreground service; otherwise, the app crashes due to the media projection permission policy. (flutter-webrtc#1552)

Use Helper.requestCapturePermission() to obtain capture permission on Android 14 specially targetSdk 34 or above.
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.

None yet

2 participants