-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add playsInline option in Video block #14500
Add playsInline option in Video block #14500
Conversation
@@ -200,6 +201,11 @@ class VideoEdit extends Component { | |||
onChange={ this.toggleAttribute( 'controls' ) } | |||
checked={ controls } | |||
/> | |||
<ToggleControl | |||
label={ __( 'Playsinline' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label={ __( 'Playsinline' ) } | |
label={ __( 'Play inline' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @swissspidy ❤️ I was quite confused about what to set the label as 😓 Fixed in this commit.
@@ -129,6 +129,7 @@ class VideoEdit extends Component { | |||
poster, | |||
preload, | |||
src, | |||
playsinline, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update this variable/attribute name to be written as playsInline
? I think it is what React expects and it also reads easier that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for yet another contribution 😃 |
Thank you so much @gziolo ❤️ |
It looks like this has been merged into Gutenberg master, but I'm not seeing the option in WordPress 5.2.2 still. Has the base version of Gutenberg in WordPress itself not been updated to the version including this patch yet? |
@fienen Only features from Gutenberg 5.3 and earlier were included in WordPress 5.2.x , which means it's not expected this is present in 5.2.2 (this was included in Gutenberg 5.4). |
…#13134) Add the video settings allowing to customize several options for the VideoPress player rendered by the video block (extended by our VideoPress extension for Gutenberg). Now, after inserting a VideoPress-enhanced video block, a user can set the following settings: - Autoplay: whether to start playing as soon as the player renders (note that some browsers can prevent a video from being autoplayed). - Loop: whether to loop the video. - Muted: whether the video should start in a muted state. - Playback controls: whether show the controls to allow the user to control video playback. - Preload: what content is loaded before the video is played: - None: Indicates that the video should not be preloaded. - Metadata: Indicates that only video metadata (e.g. length) is fetched. - Auto: Indicates that the whole video file can be downloaded, even if the user is not expected to use it. - Poster image: image to be shown while the video is downloading. Given that these settings modifies the URL saved in the block content, any existing post containing a VideoPress-enhanced video block would result in a "invalid content" error. In order to support those posts, a deprecated version of the block has been added. These changes also introduces a new `playsInline` attribute (added in core in WordPress/gutenberg#14500), but it's currently unmodifiable, since VideoPress doesn't support it yet.
Sorry, but I still get the following warning when I add a video block to my page.
|
@danihazler Thanks for your feedback, this is an old PR. Can you open a new issue? Which browser are you using? |
Description
This PR closes #14422 which requests the addition of a
playsInline
option in thevideo
block.How has this been tested?
This PR has been tested by going through the following steps:
InspectorControls
.playsinline
attribute to the<video>
tag.Screenshots
Types of changes
This PR just mocks the other attributes in the block like "Autoplay", "Muted" and acts accordingly.
Checklist: