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:
KhooLy 2026-07-02 00:46:36 +03:00
parent a32c01faba
commit a2e85be74c

View file

@ -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