mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 00:01:08 +01:00
Gifs stop or lower volume of other media playing.
Fixes #14297 Co-authored-by: Alex Hart <alex@signal.org>
This commit is contained in:
committed by
Alex Hart
parent
b81c1eb65c
commit
ad381783f7
@@ -1,14 +1,21 @@
|
||||
package org.thoughtcrime.securesms.video.exo
|
||||
|
||||
import androidx.media3.common.C
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
|
||||
fun ExoPlayer.configureForGifPlayback() {
|
||||
repeatMode = Player.REPEAT_MODE_ALL
|
||||
volume = 0f
|
||||
trackSelectionParameters = trackSelectionParameters.buildUpon()
|
||||
.setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, true)
|
||||
.build()
|
||||
}
|
||||
|
||||
fun ExoPlayer.configureForVideoPlayback() {
|
||||
repeatMode = Player.REPEAT_MODE_OFF
|
||||
volume = 1f
|
||||
trackSelectionParameters = trackSelectionParameters.buildUpon()
|
||||
.setTrackTypeDisabled(C.TRACK_TYPE_AUDIO, false)
|
||||
.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user