mirror of
https://github.com/FluxaMedia/fluxa.git
synced 2026-08-18 04:55:58 +00:00
Release expanded-poster trailer player when playback stops
Each once-focused card kept its ExoPlayer instance alive until the card left composition, so scrolling a shelf accumulated idle decoders. Release on stop caps live trailer players at one.
This commit is contained in:
parent
a32c01faba
commit
a2e85be74c
1 changed files with 2 additions and 2 deletions
|
|
@ -160,8 +160,8 @@ internal fun TvMovieCard(
|
|||
LaunchedEffect(trailerUrl) {
|
||||
val url = trailerUrl
|
||||
if (url == null) {
|
||||
trailerPlayer?.stop()
|
||||
trailerPlayer?.clearMediaItems()
|
||||
trailerPlayer?.release()
|
||||
trailerPlayer = null
|
||||
} else {
|
||||
val playerInstance = trailerPlayer ?: androidx.media3.exoplayer.ExoPlayer.Builder(context).build().also { trailerPlayer = it }
|
||||
playerInstance.volume = 0f
|
||||
|
|
|
|||
Loading…
Reference in a new issue