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

Feature/android media session #1780

Closed

Conversation

matejpolak
Copy link

@matejpolak matejpolak commented Oct 2, 2019

Describe the changes

Added mediaSession for Android ExoPlayer to let device know about currently used player. With this in place you can use some native features like pause/play using HW buttons on any compatible headset connected to the device, displaying playback buttons in PIP window (previous, play/pause, next), etc..

Currently using the simplest solution with usage of external ExoPlayer mediaSession extension library, which takes care of all needed mediaSession callback, and the session it self. To support more advanced features, full implementation may be needed.

Since I'm not an Android expert, it's possible that some things, or additional metadata are missing. Please consider this as MVP which is currently implemented mainly to support PIP player controls. Feel free to suggest any change or pick deeper implementation if needed.

Also added onExternalPauseToggled event prop, which notifies client about new play/pause state, so JS can perform needed actions based on this information. For example change UI state.

@rogerkerse
Copy link

Hi, what is the state with this pull request? 😊 Would be very grateful if it got merged. We are using picture in picture on Android through another library, but since current version of react-native-video doesn't have media session, there are no playback buttons :(

@EyMaddis
Copy link

EyMaddis commented Jul 2, 2021

Just a heads up if this ever gets merged:
onExternalPauseToggled is not necessary, there is already the prop onPlaybackRateChange that should be able to do the same. I just stumbled onto this PR, I did not test it.

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are having a similar problem, please open a new issue and reference this one instead of commenting on a stale or closed issue.

@stale stale bot added the stale Closed due to inactivity or lack or resources label Apr 19, 2022
@hueniverse hueniverse added stale Closed due to inactivity or lack or resources and removed stale Closed due to inactivity or lack or resources ExoPlayer labels Apr 20, 2022
@hueniverse hueniverse closed this Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Platform: Android stale Closed due to inactivity or lack or resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants