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

android screen share #50

Open
RobinKamps opened this issue Sep 1, 2020 · 1 comment
Open

android screen share #50

RobinKamps opened this issue Sep 1, 2020 · 1 comment

Comments

@RobinKamps
Copy link

First: thank you very much for your effort you put into this project.

On android screen share i get an error: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION.

It boils down that the manifest needs: <service android:name=".service.DisplayRecorderService" android:foregroundServiceType="mediaProjection"/> in the application section.

From minSdkVersion 28 on <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/ is required.

However even when using the above i get the same error.
Perhaps it happens because this is not implemented in https://github.com/triniwiz/fancy-webrtc-android/blob/master/fancywebrtc/src/main/AndroidManifest.xml

This info found on StackOverflow could also be useful:

Make sure you call startForeground() before getMediaProjection()!

The best solution is to call startForeground() from onCreate() without any conditions,
 displaying some sort of default messages in notification.
 Then you can execute your logic and call NotificationManager.notify() with updated notification at any time.
@triniwiz
Copy link
Owner

triniwiz commented Sep 1, 2020

Will check this out

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

No branches or pull requests

2 participants