From 69c06501fc9a33f46b7ac124e84617bba5f6f010 Mon Sep 17 00:00:00 2001 From: Siobhan Bamber Date: Wed, 28 Feb 2024 16:20:24 +0000 Subject: [PATCH] RNMobile: Ensure `playsInline` attribute conforms when falling back to core Video block (#35981) * fix: Rename playsInline to conform to Video block Co-Authored-By: Carlos Garcia <14905380+fluiddot@users.noreply.github.com> * docs: Add CHANGELOG entry --------- Co-authored-by: Carlos Garcia <14905380+fluiddot@users.noreply.github.com> --- ...ile-ensure-playsinline-setting-confirms-to-core-video | 4 ++++ .../plugins/jetpack/extensions/blocks/videopress/save.js | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/rnmobile-ensure-playsinline-setting-confirms-to-core-video diff --git a/projects/plugins/jetpack/changelog/rnmobile-ensure-playsinline-setting-confirms-to-core-video b/projects/plugins/jetpack/changelog/rnmobile-ensure-playsinline-setting-confirms-to-core-video new file mode 100644 index 0000000000000..dbdcbc45db5e0 --- /dev/null +++ b/projects/plugins/jetpack/changelog/rnmobile-ensure-playsinline-setting-confirms-to-core-video @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +RNMobile: Ensure playsInline setting always conforms to Video block schema. diff --git a/projects/plugins/jetpack/extensions/blocks/videopress/save.js b/projects/plugins/jetpack/extensions/blocks/videopress/save.js index 2c6b81eae8cd0..a731b3ea65c29 100644 --- a/projects/plugins/jetpack/extensions/blocks/videopress/save.js +++ b/projects/plugins/jetpack/extensions/blocks/videopress/save.js @@ -42,7 +42,14 @@ const VideoPressSave = CoreVideoSave => props => { * @see https://github.com/WordPress/gutenberg/blob/c5f9bd88125282a0c35f887cc8d835f065893112/packages/editor/src/hooks/generated-class-name.js#L42 * @see https://github.com/Automattic/wp-calypso/pull/30546#issuecomment-463637946 */ - return CoreVideoSave( props ); + // Rename `playsinline` to `playsInline` to conform the block schema of core Video block. + const { playsinline: videoPressPlayinline, ...restAttributes } = props.attributes; + const coreVideoAttributes = { ...restAttributes, playsInline: playsinline }; + + return CoreVideoSave( { + ...props, + attributes: coreVideoAttributes, + } ); } const url = getVideoPressUrl( guid, {