launch

fun launch(context: Context, serviceClass: Class<out DefaultScreenRecorderService>, onServiceCreated: (IVideoStreamer<*>) -> Unit, onServiceDisconnected: (name: ComponentName?) -> Unit = {}, customBundle: Bundle = Bundle(), enableAudio: Boolean = false): ServiceConnection

Starts and binds the service with the appropriate parameters.

Return

the service connection. Use it to Context.unbindService when you don't need the service anymore.

Parameters

context

the application context.

serviceClass

the service class to launch. It is a children of DefaultScreenRecorderService.

customBundle

the user defined Bundle. It will be passed to the service. You can retrieve it in createStreamer method.

onServiceCreated

the callback that returns a children of DefaultScreenRecorderService instance when the service has been connected.

onServiceDisconnected

the callback that will be called when the service is disconnected.

enableAudio

enable audio recording.


fun launch(context: Context, serviceClass: Class<out DefaultScreenRecorderService>, connection: ServiceConnection, customBundle: Bundle = Bundle(), enableAudio: Boolean = false)

Starts and binds the service with the appropriate parameters.

Parameters

context

the application context.

serviceClass

the service class to launch. It is a children of DefaultScreenRecorderService.

connection

the service connection.

customBundle

the user defined Bundle. It will be passed to the service. You can retrieve it in createStreamer method.

enableAudio

enable audio recording.