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

Fixes youtube player playsinline variable type #989

Merged
merged 1 commit into from
Aug 21, 2020
Merged

Fixes youtube player playsinline variable type #989

merged 1 commit into from
Aug 21, 2020

Conversation

gregorybolkenstijn
Copy link
Contributor

I found this bug when embedding a Youtube player on Safari mobile. Passing true would create playsinline=true, which didn't enable the inline playback. I could fix it by passing 1 as value, but then I got this warning: Warning: Failed prop type: Invalid prop 'playsinline' of type 'number' supplied to 'Player', expected 'boolean'.

playsinline should be a number as per the Youtube player documentation: https://developers.google.com/youtube/player_parameters#playsinline

Valid values are:
0: This value causes fullscreen playback. This is currently the default value, though the default is subject to change.
1: This value causes inline playback for UIWebViews created with the allowsInlineMediaPlayback property set to TRUE.

@storyworks
Copy link

Maybe you could update the types defined in https://github.com/CookPete/react-player/blob/master/src/props.js from bool to 0 | 1?

@cookpete cookpete merged commit 736618c into cookpete:master Aug 21, 2020
@cookpete
Copy link
Owner

Thanks for the PR @gregorybolkenstijn !

@storyworks There is no need to change the types. The prop is still a bool – this just maps that bool to 0 or 1 in the youtube player params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants