-
-
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
React Native Video Picture In Picture for Android #2621
Comments
I investogated this issue on android, but pip is linked to an activity, not a view, so it shall not be react-native-video to handle pip (in my point of view). |
Is there any way that I could implement this feature in react native? |
I reopen this issue as there is a real topic on it. |
I also need this feature in my current project but I don't know how add it. |
PR #1776 was have some issues
Android PIP life cycle managed by activity (already @freeboub mentioned) FYI) https://stackoverflow.com/questions/51876716/listen-for-home-button-press |
I improved the loading time of the video by using the following technique. Idk if it's the right one, but it greatly decreased the loading time. First I added the following buffer config. I played with the numbers and found these useful bufferConfig={{
minBufferMs: 15000,
maxBufferMs: 20000,
bufferForPlaybackMs: 2500,
bufferForPlaybackAfterRebufferMs: 5000,
}} Second, I follow the steps on this https://github.com/react-native-video/react-native-video/issues/2611 to enable the google android exoplayer. |
From my research, you can use the default activity if you just provide the manifest some more props and add a couple overrides in the class. See here: https://developer.android.com/guide/topics/ui/picture-in-picture |
Is there any updated PR or Fork available with fix PIP? |
Yes, I also want to see the PiP on Android. This is an very important feature for video playback on modern devices. |
I would love if someone could make a pr to add pip support for android too |
@freeboub
Which way should we work? Also, it would be nice to know if the pictureInPicture prop will work on app exit like iOS or separate like pictureInPicture/pictureInPictureOnLeave. |
@YangJonghun I did a proof of concept for this feature also. Let's try to sum up Issues I encounter and how I proceed:
In order to avoid behavior changes with other applications, I added following api to control exactly what to do with lifecycle (but I think option 2 is mandatory to be able to implement it) Last point it is mandatory to implement it in the sample app ! lifecycleControl android player lifecycle policy.
Possible values:
Start:
Platforms: Android |
A poc available here for info : https://github.com/FernandoAOborges/REACT-NATIVE-PIP-ANDROID |
@freeboub
If you'd like, I will create a PR with a WIP status. |
Hello, Thank you for the PR, can you open a PR in draft, it will allow to comment on it. I have a first point here:
You cannot do like this, when another application will go over the app, it will automatically switch to Pip ... Second point, I don't understand why you use a dedicated fragment : ReactExoplayerFragment can you explain why you had to use it please ? (point to doc or other sample is enough) Another interesting point would be to enable pip in sample to be able to test easily ! |
@YangJonghun I put the comment in the PR (I split it be able to use threads). Thank you ! |
Feature Request
Enable Picture In Picture for video streaming on the android platform as well.
Why it is needed
If the video is a bit long, it works quite reasonably on the ios due to the picture in picture prop availability. On Android, however, the video plays only after it completely loads. The picture in picture prop really required on the android platform as well.
Possible implementation
Code sample
The text was updated successfully, but these errors were encountered: