diff --git a/packages/block-library/src/video/edit.js b/packages/block-library/src/video/edit.js index 88b2669e66f56..db1fbb197126a 100644 --- a/packages/block-library/src/video/edit.js +++ b/packages/block-library/src/video/edit.js @@ -75,10 +75,20 @@ function VideoEdit( { const posterImageButton = useRef(); const { id, controls, poster, src, tracks } = attributes; const isTemporaryVideo = ! id && isBlobURL( src ); - const mediaUpload = useSelect( - ( select ) => select( blockEditorStore ).getSettings().mediaUpload, - [] - ); + const { mediaUpload, multiVideoSelection } = useSelect( ( select ) => { + const { getSettings, getMultiSelectedBlockClientIds, getBlockName } = + select( blockEditorStore ); + const multiSelectedClientIds = getMultiSelectedBlockClientIds(); + + return { + mediaUpload: getSettings().mediaUpload, + multiVideoSelection: + multiSelectedClientIds.length && + multiSelectedClientIds.every( + ( _clientId ) => getBlockName( _clientId ) === 'core/video' + ), + }; + }, [] ); useEffect( () => { if ( ! id && isBlobURL( src ) ) { @@ -185,25 +195,29 @@ function VideoEdit( { return ( <> - - { - setAttributes( { tracks: newTracks } ); - } } - /> - - - - + { ! multiVideoSelection && ( + <> + + { + setAttributes( { tracks: newTracks } ); + } } + /> + + + + + + ) }