Unverified Commit d3bda4a2 authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Don't affect pause status after playing in the background

parent d0de96da
Loading
Loading
Loading
Loading
+5 −0
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ class ReactExoplayerView extends FrameLayout implements
    private int resumeWindow;
    private long resumePosition;
    private boolean loadVideoStarted;
    private boolean isInBackground;
    private boolean isPaused = true;
    private boolean isBuffering;
    private float rate = 1f;
@@ -174,11 +175,15 @@ class ReactExoplayerView extends FrameLayout implements

    @Override
    public void onHostResume() {
        if (!playInBackground || !isInBackground) {
            setPlayWhenReady(!isPaused);
        }
        isInBackground = false;
    }

    @Override
    public void onHostPause() {
        isInBackground = true;
        if (playInBackground) {
            return;
        }