setEnableActivityLifecycle

fun setEnableActivityLifecycle(enableActivityLifecycle: Boolean)

Enables (default) or disables pausing the local webcam while the app is backgrounded.

While on, the activity stopping turns the camera off (about half a second after the app leaves the screen on the devices tested), so peers get onStreamDisabled for the video. The microphone stays on. When the activity resumes, the camera comes back with the same capture settings, but only if this pause turned it off: a camera that was already off when the app went to the background stays off.

The SDK runs no foreground service. From Android 15 the system blocks a backgrounded app's network, so an app that must keep the call while in the background needs its own foreground service of the camera or microphone type.

Parameters

enableActivityLifecycle

false keeps the camera publishing in the background, which picture-in-picture needs.