mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Do not autoplay in video editor.
This commit is contained in:
committed by
Greyson Parrelli
parent
731683ae09
commit
62f9f19540
@@ -93,6 +93,7 @@ public class VideoPlayer extends FrameLayout {
|
||||
if (playerCallback != null) {
|
||||
switch (playbackState) {
|
||||
case Player.STATE_READY:
|
||||
playerCallback.onReady();
|
||||
if (playWhenReady) playerCallback.onPlaying();
|
||||
break;
|
||||
case Player.STATE_ENDED:
|
||||
@@ -137,6 +138,14 @@ public class VideoPlayer extends FrameLayout {
|
||||
exoView.setResizeMode(resizeMode);
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
if (this.exoPlayer != null) {
|
||||
return this.exoPlayer.isPlaying();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
if (this.exoPlayer != null) {
|
||||
this.exoPlayer.setPlayWhenReady(false);
|
||||
@@ -332,6 +341,8 @@ public class VideoPlayer extends FrameLayout {
|
||||
|
||||
public interface PlayerCallback {
|
||||
|
||||
default void onReady() {}
|
||||
|
||||
void onPlaying();
|
||||
|
||||
void onStopped();
|
||||
|
||||
Reference in New Issue
Block a user