react-native-vimeo-iframe icon indicating copy to clipboard operation
react-native-vimeo-iframe copied to clipboard

Android Fullscreen doesn't work in portrait

Open jwktje opened this issue 2 years ago • 9 comments

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?

jwktje avatar Mar 02 '23 20:03 jwktje

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.

7assenTlili avatar Mar 14 '23 08:03 7assenTlili

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 avatar Mar 19 '23 01:03 Marcoo09

@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.

jwktje avatar Mar 20 '23 09:03 jwktje

@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 avatar Mar 26 '23 19:03 Marcoo09

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

nupurpurohit avatar Apr 07 '23 07:04 nupurpurohit

Can we manually remove fullscreen option? @Marcoo09

nupurpurohit avatar Apr 07 '23 07:04 nupurpurohit

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

nupurpurohit avatar Apr 07 '23 11:04 nupurpurohit

@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 avatar Apr 12 '23 07:04 hryhoriiK97

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}
            />
           

hryhoriiK97 avatar Apr 12 '23 07:04 hryhoriiK97