Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions packages/block-library/src/video/edit-common-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
return ( newValue ) => {
setAttributes( {
[ attribute ]: newValue,
// Set muted when autoplay changes
...( attribute === 'autoplay' && { muted: newValue } ),
// Set muted and playsInLine when autoplay changes
// playsInline is set to true when autoplay is true to support iOS devices
...( attribute === 'autoplay' && {
muted: newValue,
playsInline: newValue,
} ),
} );
};
};
Expand Down Expand Up @@ -135,9 +139,14 @@ const VideoSettings = ( { setAttributes, attributes } ) => {
label={ __( 'Play inline' ) }
onChange={ toggleFactory.playsInline }
checked={ !! playsInline }
help={ __(
'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'
) }
disabled={ autoplay }
help={
autoplay
? __( 'Play inline enabled because of Autoplay.' )
: __(
'When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.'
)
}
/>
</ToolsPanelItem>
<ToolsPanelItem
Expand Down