fix(android): keep screen on on fullscreen (#3563)
add KEEP_SCREEN_ON flag when video is fullscreen & playing to avoid phone to go off.
inspired by 2d8466128d
This commit is contained in:
@@ -406,7 +406,7 @@ public class ReactExoplayerView extends FrameLayout implements
|
||||
}
|
||||
|
||||
if (fullScreenPlayerView == null) {
|
||||
fullScreenPlayerView = new FullScreenPlayerView(getContext(), exoPlayerView, playerControlView, new OnBackPressedCallback(true) {
|
||||
fullScreenPlayerView = new FullScreenPlayerView(getContext(), exoPlayerView, this, playerControlView, new OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
setFullscreen(false);
|
||||
@@ -1966,6 +1966,10 @@ public class ReactExoplayerView extends FrameLayout implements
|
||||
this.disableBuffering = disableBuffering;
|
||||
}
|
||||
|
||||
public boolean getPreventsDisplaySleepDuringVideoPlayback() {
|
||||
return preventsDisplaySleepDuringVideoPlayback;
|
||||
}
|
||||
|
||||
private void updateFullScreenButtonVisbility() {
|
||||
if (playerControlView != null) {
|
||||
final ImageButton fullScreenButton = playerControlView.findViewById(R.id.exo_fullscreen);
|
||||
|
||||
Reference in New Issue
Block a user