Skip to content

Fixes youtube player playsinline variable type - #989

Merged
cookpete merged 1 commit into
cookpete:masterfrom
gregorybolkenstijn:fix/youtube-playervars
Aug 21, 2020
Merged

Fixes youtube player playsinline variable type#989
cookpete merged 1 commit into
cookpete:masterfrom
gregorybolkenstijn:fix/youtube-playervars

Conversation

@gregorybolkenstijn

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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