Video Block: Use existing video poster image on insert. #34415
Conversation
3ce40bf
to
eb4334e
Thanks for working on this! This change makes the video block, without a poster added by the user, show the default image, which IMO is not so good compared to the video preview that is being shown right now.. I haven't checked how and if we can obtain the |
setAttributes( { | ||
src: media.url, | ||
id: media.id, | ||
poster: media?.image?.src, |
ntsekouras
Sep 1, 2021
Contributor
Here media
is an object, so no need to use media?.
.
Here media
is an object, so no need to use media?.
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Description
When selecting a video in the video block, automatically use the poster image (from a video's featured image) when it is assigned.
Side note for testing:
While working on this, I found #34411. Removing the poster does not currently work (with or without this PR), but should after #34411 is merged.
Fixes: #21553
How has this been tested?
Tested on
wp-env
.From the #21553 description:
Then:
Screenshots
Before:
poster-before-patch.mov
After:
poster-after-patch.mov
Types of changes
Enhancement
Checklist:
*.native.js
files for terms that need renaming or removal).