setShouldPauseOnBackground

abstract fun setShouldPauseOnBackground(shouldPauseOnBackground: Boolean)

Sets the behavior of the video player when the host activity is paused.

If shouldPauseOnBackground is set to true, the video playback pauses when the host activity's OnPause() method is called. This can be useful for situations where you don't want the video to continue playing if the user is not actively interacting with your application.

If shouldPauseOnBackground is set to false, the video playback continues even when the host activity is in the paused state. Note that this means the audio from the video continues to play even if the application is in the background.

Parameters

shouldPauseOnBackground

Boolean value indicating whether video playback should be paused when the host activity is paused. Defaults to true.