-
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
feat: add full screen support based on expo-av implementation #2763
feat: add full screen support based on expo-av implementation #2763
Conversation
899ee77
to
640baeb
Compare
640baeb
to
f08ab91
Compare
Here is the sample code from expo-av https://github.com/expo/expo/blob/main/packages/expo-av/android/src/main/java/expo/modules/av/video/FullscreenVideoPlayer.java |
Nice nice :) Tried it out in my application. It goes fullscreen fine, but when I go back video doesn't work anymore (Audio still is fine). After that if I go back to fullscreen video still works there. Could be emulator issue. Or something else on my end. Haven't investigated too much yet. I wonder if it could bypass portrait lock in android and go forced landscape React Native: 0.66.3 |
Can you try using the built in control? |
Tested on a real device now. Same thing. Using built-in controls doesn't work. Video style video: (floatingPlayer) => {
const baseStyles = {
width: '100%',
aspectRatio: 16 / 9,
};
if (floatingPlayer) {
return {
...baseStyles,
borderTopLeftRadius: 3,
borderTopRightRadius: 3,
borderWidth: 3,
borderBottomWidth: 0,
borderColor: colors.videoTimerBackground,
};
}
return {
...baseStyles,
};
}, I added const baseStyles = {
width: '100%',
height: '100%',
aspectRatio: 16 / 9,
}; And now it works. Tho video now takes all the screen. Seems like when it goes back to the screen it can't guess the right height. |
Maybe I figured it out. When it puts view back in the parent it breaks my overlay controls. It puts video not under the controls, but below. I will check if I see a way to fix it Seems like another issue is if I use the back button while in fullscreen I can't open fullscreen again. |
Hello everyone,
React Native: 0.68.2 FILE.2022-08-09.00.44.19.mp4 |
@lewatt23 did you include exo_player_control_view.xml? If yes, try clean build |
@wood1986 no i have not, please can you expain to me how i can include it? thanks. |
How did you pick my change and then apply to your branch? |
I did clone your branch and added it to my project using yarn, not sure if its the correct way ^^!. |
Check this example https://github.com/wood1986/react-native-fullscreen-example.git |
@wood1986 thanks i was able to test it, it works perfectly :) |
Great work, tested in my project and it's working just fine. |
android/src/main/java/com/brentvatne/exoplayer/FullScreenPlayerView.java
Outdated
Show resolved
Hide resolved
You can ignore my comment. it is done |
|
Please take a small video |
I think the back button issue is fixed. Please try the latest commit |
e717393
to
d54cba2
Compare
Noticed |
I have not update my branch to use latest commit. But I cannot reproduce |
a92ba2a
to
a79c30e
Compare
Just tested on sample , It doesn't build (just a matter of depenency I think): can you either add the dependancy in sample & in doc |
Please also add a line in README.md |
What information do I need to add to README.md? |
@freeboub I updated the dependency. I should run now. You can also check https://github.com/wood1986/react-native-fullscreen-example.git to test it |
Tested on Android TV emulator with the sample.
I add |
added |
@freeboub this needs an entry in the changelog and updating the documentation about android fullscreen |
Thank you @evoactivity, I pushed a PR to update the basic sample to make controls testable here : #2852 |
Finally!! Thanks for the merge |
BTW, when will you publish the alpha or beta or final to npm? |
@wood1986 I should sync up on Monday for this. There are some ios blocking issues with build which makes me threaten ... |
Why full screen works only while using default controls but settings 'fullscreen' prop just hides status bar? |
Because people may have their own full screen implementation which is before my full screen work. One of the example is the player is not inside the scroll view. |
@wood1986 So there is no way of having fullscreen player popup with custom controls? |
are you asking the controls inside fullscreen or the control for opening fullscreen? |
Controls opening fullscreen. Because calling player.presentFullScreen() is not working |
Question: we’re using react-native-version 0.67.4, and thus can not yet upgrade to the latest react-native-video version who includes the feature |
ı compare my library with yours everythinks are same but full screen button still not showing. what ım missing |
I saw #2688. Based on the description, it seems the implementation affected the stability of v6. I have an implementation which touches the minimal code. My implementation is based on expo-av implementation and use Dialog to do full screen.