HBRecorder icon indicating copy to clipboard operation
HBRecorder copied to clipboard

Please elaborate how to use ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION for screen recorder

Open legacyGlitch opened this issue 5 years ago • 3 comments

I just want to make a screen recorder for API level 30 and above but IDE is throwing Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION error.

Please provide a solution to overcome this problem, because I don't want to use any dependency to build the screen recorder.

Thank you!

legacyGlitch avatar Jan 25 '21 12:01 legacyGlitch

Have a look at the read me. Specifically point 4 in Implementing the library

You need the following in your Manifest:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

HBiSoft avatar Jan 25 '21 14:01 HBiSoft

I don't want to use implementation 'com.github.HBiSoft:HBRecorder:0.1.15' I just want to develop a screen recorder without any third party library, your library is working fantastic but this is not what I want to do, I am using android's native functions and APIs to develope the screen recorder. ie: MediaProjection, MediaRecorder, VirtualDisplay.

I hope you got my point. Thanks.

legacyGlitch avatar Jan 26 '21 08:01 legacyGlitch

I'm not sure what you want from me.

This is a library and only issues related to the library should be opened.

If you what to know how to use/implement MediaProjection , MediaRecorder and VirtualDisplay you are more than welcome to have a look how I did it in the library.

HBiSoft avatar Jan 28 '21 07:01 HBiSoft