mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Move story post display logic into a single fragment.
This commit is contained in:
@@ -65,6 +65,7 @@ public class VideoPlayer extends FrameLayout {
|
||||
private long clippedStartUs;
|
||||
private ExoPlayerListener exoPlayerListener;
|
||||
private Player.Listener playerListener;
|
||||
private boolean muted;
|
||||
|
||||
public VideoPlayer(Context context) {
|
||||
this(context, null);
|
||||
@@ -130,6 +131,9 @@ public class VideoPlayer extends FrameLayout {
|
||||
exoPlayer.addListener(playerListener);
|
||||
exoView.setPlayer(exoPlayer);
|
||||
exoControls.setPlayer(exoPlayer);
|
||||
if (muted) {
|
||||
mute();
|
||||
}
|
||||
}
|
||||
|
||||
mediaItem = MediaItem.fromUri(Objects.requireNonNull(videoSource.getUri()));
|
||||
@@ -139,12 +143,14 @@ public class VideoPlayer extends FrameLayout {
|
||||
}
|
||||
|
||||
public void mute() {
|
||||
this.muted = true;
|
||||
if (exoPlayer != null && exoPlayer.getAudioComponent() != null) {
|
||||
exoPlayer.getAudioComponent().setVolume(0f);
|
||||
}
|
||||
}
|
||||
|
||||
public void unmute() {
|
||||
this.muted = false;
|
||||
if (exoPlayer != null && exoPlayer.getAudioComponent() != null) {
|
||||
exoPlayer.getAudioComponent().setVolume(1f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user