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

Android Fullscreen doesn't work in portrait #53

Open
jwktje opened this issue Mar 2, 2023 · 9 comments
Open

Android Fullscreen doesn't work in portrait #53

jwktje opened this issue Mar 2, 2023 · 9 comments
Labels
bug Something isn't working information requested Extra information is needed

Comments

@jwktje
Copy link

jwktje commented Mar 2, 2023

Running Expo Go on a physical Android device, the Fullscreen behaviour seems broken.
When I press play inline, it all works well. When I then press fullscreen, it shows the player in a large white webview.

Here is the strange thing. When I minimize the app (as in; navigate away but don't kill Expo go) and come back, it shows correctly in a portrait fullscreen view. Also if I press the Android rotate button on the bottom right (which I don't know if all versions have) it works fine in landscape.

On iOS I also have no problems. So it really boils down to Android in Portrait upon first pressing the fullscreen button.

Check out this screenshot that shows my issue.
Screenshot_20230302-213914

I really want to solve this. What can I do to get this issue resolved?

@7assenTlili
Copy link

I am having the same issue. I don't have a fix yet but what I noticed is that if I give the view wrapping the player more height (i.e 800), it works.

This is most likely related to react-native-webview, there is a similar thread for youtube where they suggest using a custom user-agent but this didn't work for me.

@Marcoo09
Copy link
Contributor

Hi @jwktje
Could you push on Github the example of the screenshot? I'll see it next week.
I've just tested on Android with the example app and it's working propertly both android and ios.

@Marcoo09 Marcoo09 added the question Further information is requested label Mar 19, 2023
@jwktje
Copy link
Author

jwktje commented Mar 20, 2023

@Marcoo09 @7assenTlili Here is a minimal example of when the issue occurs. This code works fine in fullscreen on iOS, but on Android it doesn't.

import {View} from 'react-native';
import {Vimeo} from "react-native-vimeo-iframe";

export default function App() {
    return (
        <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
            <View style={{height: 170, width: 300}}>
                <Vimeo videoId={'226053498'}/>
            </View>
        </View>
    );
}

For me at least, when running this on an Android device the "fullscreen" opens in a huge white page like in my earlier screenshot. This only goes away if you do any of the following;

  • Force rotation to landscape and back to portrait
  • Blur/focus the app. So either leaving and coming back to it, or swipe up and hold the app in the overview of open apps for a while
  • Give the wrapping view a large height (which I can't do for layout purposes)

It seems that basically the app needs to be triggered to reconsider the Webview height after going full screen. And when it does that, it fixes itself. But upon initial pressing of fullscreen, the layout is broken.

@Marcoo09 Marcoo09 added bug Something isn't working and removed question Further information is requested labels Mar 20, 2023
@Marcoo09
Copy link
Contributor

@jwktje thanks for the information. I've tried this on a couple of physical Android devices with different OS versions, but it works for me.
Could you tell me which version of React Native, Android and React Native WebView are you using? Also let me know what model of device you are using and if you have Chrome or what browser as default.

@Marcoo09 Marcoo09 added the information requested Extra information is needed label Mar 26, 2023
@nupurpurohit
Copy link

I am facing same issue in samsung galaxy m52
Screenshot (524)

@nupurpurohit
Copy link

nupurpurohit commented Apr 7, 2023

Can we manually remove fullscreen option?
@Marcoo09

@nupurpurohit
Copy link

why does in iOS when play button is clicked video plays in fullscreen? @Marcoo09

@hryhoriiK97
Copy link

@nupurpurohit In your Vimeo account settings, you can hide the fullscreen button for your videos.

Zrzut ekranu 2023-04-12 o 09 36 53

@hryhoriiK97
Copy link

hryhoriiK97 commented Apr 12, 2023

why does in iOS when play button is clicked video plays in fullscreen? @Marcoo09
Add this line of code allowsInlineMediaPlayback={true}, it should prevent opening Vimeo player in full-screen.

          <Vimeo
                videoId={yourVideoId}
                containerStyle={styles.vimeoPlayerContainer}
                allowsInlineMediaPlayback={true}
            />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working information requested Extra information is needed
Projects
None yet
Development

No branches or pull requests

5 participants