Skip to content

Commit

Permalink
refactor: Remove unused video block code (#59378)
Browse files Browse the repository at this point in the history
Co-authored-by: SiobhyB <[email protected]>
Co-authored-by: derekblank <[email protected]>
Co-authored-by: fluiddot <[email protected]>
  • Loading branch information
4 people authored Feb 27, 2024
1 parent d6dd164 commit b3f5174
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
7 changes: 2 additions & 5 deletions packages/block-library/src/video/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class VideoEdit extends Component {
render() {
const { setAttributes, attributes, isSelected, wasBlockJustInserted } =
this.props;
const { id, src, guid } = attributes;
const { id, src } = attributes;
const { videoContainerHeight } = this.state;

const toolbarEditButton = (
Expand All @@ -236,10 +236,7 @@ class VideoEdit extends Component {
></MediaUpload>
);

// NOTE: `guid` is not part of the block's attribute definition. This case
// handled here is a temporary fix until a we find a better approach.
const isSourcePresent = src || ( guid && id );
if ( ! isSourcePresent ) {
if ( ! src ) {
return (
<View style={ { flex: 1 } }>
<MediaPlaceholder
Expand Down
14 changes: 0 additions & 14 deletions packages/block-library/src/video/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@ describe( 'Video block', () => {
initialHtml: `
<!-- wp:video {"id":1234} -->
<figure class="wp-block-video"><video controls src="https://VIDEO_URL.mp4"></video></figure>
<!-- /wp:video -->
`,
} );
const addVideoButton = screen.queryByText( 'Add video' );
expect( addVideoButton ).toBeNull();
} );

it( `should not render empty state when 'guid' and 'id' attributes are present`, async () => {
await initializeEditor( {
initialHtml: `
<!-- wp:video {"guid":"ABCD1234","id":1234 -->
<figure class="wp-block-video wp-block-embed is-type-video is-provider-videopress"><div class="wp-block-embed__wrapper">
https://videopress.com/<VIDEO_ID>
</div></figure>
<!-- /wp:video -->
`,
} );
Expand Down

0 comments on commit b3f5174

Please sign in to comment.