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

Fullscreen enabled on iOS but disabled on Android #6

Closed
TimMun opened this issue Mar 25, 2020 · 4 comments
Closed

Fullscreen enabled on iOS but disabled on Android #6

TimMun opened this issue Mar 25, 2020 · 4 comments
Labels
android question Further information is requested

Comments

@TimMun
Copy link

TimMun commented Mar 25, 2020

For all of the videos I've tried, the fullscreen button is enabled on iOS but disabled on Android. Sample code below:

<YoutubePlayer
            videoId={"c8deRYotdng"} // The YouTube video ID
            play
            onError={this.onYoutubeError}
            height={height + 20}
            width={screenWidth + 20}
            initialPlayerParams={{
              preventFullScreen: false,
              iv_load_policy: 3, 
              modestbranding: 1,
              rel: 0
            }}
          />
@LonelyCpp
Copy link
Owner

Hey, just to be clear - you want it disabled, right?

@TimMun
Copy link
Author

TimMun commented Mar 25, 2020

Oh no, I'm trying to get it enabled on both platforms.

@LonelyCpp
Copy link
Owner

LonelyCpp commented Mar 25, 2020

This is because fullscreen is disabled by default in android webviews. You need to pass in webviewProps like so -

webViewProps={{ allowsFullscreenVideo: true }}

more info here and here

I will link this in with the preventFullScreen key by default in a future update. Thanks :)

@TimMun
Copy link
Author

TimMun commented Mar 25, 2020

Ah, you're right. Thanks alot!

@TimMun TimMun closed this as completed Mar 25, 2020
@LonelyCpp LonelyCpp added android question Further information is requested labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants