-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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]: Video Player play/pause during incoming calling #3871
Comments
@Sumeeth-24 Bro I have tried this approach after lots of tries using the library you provided and finally this approach works for me, Add this line in the video component onAudioFocusChanged={event => { And disable your play pause button <Pressable |
The player works already as you describe in Android @Sumeeth-24 . See the However, I'm on 6.1.2 and my video player in my pure RN app I'm developing keeps playing on Android when it receives a call in simulator which is different from what the basic app does. It looks like they handle it with |
@Sumeeth-24
|
This would be a great addition. |
I will work on it this weekend. |
One way that this can be implemented partially is by breaking other functionality fyi @Sumeeth-24. You can let exoplayer manage its own audioFocus. If you don't need to know when audio focus is lost/gained, this is an easy solution. Edit
Then |
Description
We need functionality where the video player pauses when a call is incoming and resumes when the call ends. This should not happen automatically but should be controlled via a prop value so that our custom functionality can handle the play/pause actions.
There is an old npm package named react-native-call-detection which is outdated (last updated 4 years ago) and incompatible with the newer Android/iOS versions. This package detects different call states like Incoming, Disconnected, Dialing, and Connected for iOS. For Android, it provides states like Offhook, Incoming, Disconnected, and Missed.
Our goal is to handle at least the Incoming and Disconnected events to implement custom controls for playing and pausing the video.
Why it is needed ?
Every ott platform like Amazon Prime, Netflix, Disney plus HotStar has this functionality where any video is playing and call is coming in between then automatically the player pause and when its disconnected then it automatically starts playing. Atleast need those two event listener (Incoming and Disconnected) and then video player would be completed. Its a much needed functionality for any video player. If possible please release it as early as possible as we have made an ott platform completed with this package and react-native and only this functionality and android pip support is missing.
Possible implementation
Refer this package for idea " react-native-call-detection".
Code sample
Code sample
The text was updated successfully, but these errors were encountered: