Skip to content
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

Core integration notes #569

Open
swissspidy opened this issue Jul 16, 2024 · 0 comments
Open

Core integration notes #569

swissspidy opened this issue Jul 16, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@swissspidy
Copy link
Owner

swissspidy commented Jul 16, 2024

Working draft for things to take care of when merging into Gutenberg.

Video poster in video block

Update the onFileChange callback (onSelectVideo) to get the video's poster image from the REST API response. Right now it only supports/expects the format returned by the media modal (from wp_prepare_attachment_for_js()).

https://github.com/WordPress/gutenberg/blob/e0a413d213a2a829ece52c6728515b10b0154d8d/packages/block-library/src/video/edit.js#L94

https://github.com/WordPress/gutenberg/blob/e0a413d213a2a829ece52c6728515b10b0154d8d/packages/block-library/src/video/edit.js#L152-L153

The poster URL will be accessible via media._embedded['wp:featuredmedia'][0].source_url as long as media upload (and sideload) happens with ?_embed=wp:featuredmedia

Update callbacks in the upload queue as well:

// Video block expects such a structure for the poster.
// https://github.com/WordPress/gutenberg/blob/e0a413d213a2a829ece52c6728515b10b0154d8d/packages/block-library/src/video/edit.js#L154
const updatedAttachment = {
...attachment,
image: {
src: posterAttachment.url,
},
};

Video placeholder

Adapt WordPress/gutenberg#63643 for the video block

Save lock

Partially revert WordPress/gutenberg#41120 as the locking needs to happen before the actual upload

@swissspidy swissspidy added the documentation Improvements or additions to documentation label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant