Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flag for background mode #563

Merged
merged 2 commits into from
May 8, 2017

Conversation

deshiknaves
Copy link
Contributor

Added the missing implementation for play in background for exoplayer.

@wschurman
Copy link

@mattapperson - Friendly ping :)

@mattapperson mattapperson merged commit 72a46bc into TheWidlarzGroup:master May 8, 2017
@markusekblad
Copy link

markusekblad commented May 9, 2017

@deshiknaves @mattapperson
Great stuff, I had one issue tho,
I tried this today and for me the

public void onHostResume() {
    if (playInBackground) {
        return;
    }
    ...
}

causes the player to start as paused even with paused false prop passed.

It also didn't play in the background. However, if I remove that check from onHostResume, and add it instead to

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        if (playInBackground) {
            return;
        }
        stopPlayback();
    }

Then background audio works for me and there's no issue with the paused prop. I'm using a modal player and not the fullscreen one if that makes any difference.
(Tested on a Huawei Honor 8 and Samsung S6, both with Android 6.x)

mattvot pushed a commit to calvium/react-native-video that referenced this pull request May 12, 2017
* master:
  Added flag for background mode (TheWidlarzGroup#563)
  issue 310 - Added a new property, ignoreSilentSwitch.  (TheWidlarzGroup#403)
  Add progressUpdateInterval to android-exoplayer (TheWidlarzGroup#540)
  Initial WPF Support (TheWidlarzGroup#385)
  added progressUpdateInterval to Android (TheWidlarzGroup#512)
  load new source if it is different (TheWidlarzGroup#502)
  Pausing progress if it was playing and the stating again (TheWidlarzGroup#526)
  bump android dependencies (TheWidlarzGroup#524)
  Update ExoPlayer to r2.2.0 (TheWidlarzGroup#505)
  Update readme (TheWidlarzGroup#497)
  [Android] App crash when unmounting video (TheWidlarzGroup#533)
  Fix/494 (TheWidlarzGroup#537)
  fix(RCTVideo.m): Fixed status bar disappearing issue
wschurman pushed a commit to LimbixHealth/react-native-video that referenced this pull request Jul 13, 2017
* Added flag for background mode

* Better flag name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants