Repository: expo/expo
File: packages/expo-video/android/src/main/java/expo/modules/video/player/VideoPlayer.kt (Kotlin)

Code before:
class VideoPlayer(val context: Context, appContext: AppContext, source: VideoSource?, playerBuilderOptions: expo.modules.video.records.PlayerBuilderOptions? = null) : AutoCloseable, SharedObject(appContext), IntervalUpdateEmitter {
  // This improves the performance of playing DRM-protected content
  private var renderersFactory = DefaultRenderersFactory(context)
    .forceEnableMediaCodecAsynchronousQueueing()
    .setEnableDecoderFallback(true)
  private val listeners: MutableList<WeakReference<VideoPlayerListener>> = mutableListOf()
  private val currentVideoViewRef = MutableWeakReference<VideoView?>(null) { new, old ->
    sendEvent(PlayerEvent.TargetViewChanged(new, old))
  }
  var currentVideoView by currentVideoViewRef
  val loadControl: VideoPlayerLoadControl = VideoPlayerLoadControl()
  val subtitles: VideoPlayerSubtitles = VideoPlayerSubtitles(this)
  val audioTracks: VideoPlayerAudioTracks = VideoPlayerAudioTracks(this)
  val trackSelector = DefaultTrackSelector(context)

  val player = ExoPlayer.Builder(context, renderersFactory).apply {
    setLooper(context.mainLooper)
    setLoadControl(loadControl)
    playerBuilderOptions?.seekBackwardIncrement?.let {
      setSeekBackIncrementMs((it * 1000).toLong().coerceIn(1, 999_000))
    }
    playerBuilderOptions?.seekForwardIncrement?.let {
      setSeekForwardIncrementMs((it * 1000).toLong().coerceIn(1, 999_000))
    }
  }.build()

  internal val firstFrameEventGenerator: FirstFrameEventGenerator
  val serviceConnection = PlaybackServiceConnection(WeakReference(this), appContext)
  var mediaSession: MediaSession = buildBasicMediaSession(context, player)
  val intervalUpdateClock = IntervalUpdateClock(this)

  var playing by IgnoreSameSet(false) { new, old ->
    sendEvent(PlayerEvent.IsPlayingChanged(new, old))
  }

  var uncommittedSource: VideoSource? = source
  private var commitedSource by IgnoreSameSet<VideoSource?>(null) { new, old ->
    sendEvent(PlayerEvent.SourceChanged(new, old))
  }

  // Volume of the player if there was no mute applied.
  var userVolume = 1f
  var status: PlayerStatus = IDLE
  var requiresLinearPlayback = false
  var staysActiveInBackground = false
    set(value) {
      field = value
      if (value) {
        startPlaybackService()
      }
    }

Review comment (suggestion):
```suggestion
  val player = ExoPlayer
    .Builder(context, renderersFactory)
    .apply {
    	setLooper(context.mainLooper)
    	setLoadControl(loadControl)
    	playerBuilderOptions?.seekBackwardIncrement?.let {
      	setSeekBackIncrementMs((it * 1000).toLong().coerceIn(1, 999_000))
    	}
    	playerBuilderOptions?.seekForwardIncrement?.let {
      	setSeekForwardIncrementMs((it * 1000).toLong().coerceIn(1, 999_000))
    	}
  	}
  	.build()
```

Code after:
@UnstableApi
class VideoPlayer(val context: Context, appContext: AppContext, source: VideoSource?, playerBuilderOptions: expo.modules.video.records.PlayerBuilderOptions? = null) : AutoCloseable, SharedObject(appContext), IntervalUpdateEmitter {
  // This improves the performance of playing DRM-protected content
  private var renderersFactory = DefaultRenderersFactory(context)
    .forceEnableMediaCodecAsynchronousQueueing()
    .setEnableDecoderFallback(true)
  private val listeners: MutableList<WeakReference<VideoPlayerListener>> = mutableListOf()
  private val currentVideoViewRef = MutableWeakReference<VideoView?>(null) { new, old ->
    sendEvent(PlayerEvent.TargetViewChanged(new, old))
  }
  var currentVideoView by currentVideoViewRef
  val loadControl: VideoPlayerLoadControl = VideoPlayerLoadControl()
  val subtitles: VideoPlayerSubtitles = VideoPlayerSubtitles(this)
  val audioTracks: VideoPlayerAudioTracks = VideoPlayerAudioTracks(this)
  val trackSelector = DefaultTrackSelector(context)

  val player = ExoPlayer
    .Builder(context, renderersFactory)
    .apply {
      setLooper(context.mainLooper)
      setLoadControl(loadControl)
      playerBuilderOptions?.seekBackwardIncrement?.let {
        setSeekBackIncrementMs((it).toLong(DurationUnit.MILLISECONDS).coerceIn(1, 999_000))
      }
      playerBuilderOptions?.seekForwardIncrement?.let {
        setSeekForwardIncrementMs((it).toLong(DurationUnit.MILLISECONDS).coerceIn(1, 999_000))
      }
    }.build()

  internal val firstFrameEventGenerator: FirstFrameEventGenerator
  val serviceConnection = PlaybackServiceConnection(WeakReference(this), appContext)
  var mediaSession: MediaSession = buildBasicMediaSession(context, player)
  val intervalUpdateClock = IntervalUpdateClock(this)

  var playing by IgnoreSameSet(false) { new, old ->
    sendEvent(PlayerEvent.IsPlayingChanged(new, old))
  }

  var uncommittedSource: VideoSource? = source
  private var commitedSource by IgnoreSameSet<VideoSource?>(null) { new, old ->
    sendEvent(PlayerEvent.SourceChanged(new, old))
  }

  // Volume of the player if there was no mute applied.
  var userVolume = 1f
  var status: PlayerStatus = IDLE
  var requiresLinearPlayback = false
  var staysActiveInBackground = false
    set(value) {
      field = value
      if (value) {