-
Notifications
You must be signed in to change notification settings - Fork 798
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
VideoPress: add unique ID attributes to videopress elements #39460
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
I added Apex to see the PR as well, just as an FYI, as they own VideoPress on the Dotcom side. |
Definitely an edge case. We can do a follow up on if is is requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks reasonable to me at a quick read-through. I haven't tested it though.
I left one comment inline that's not really related to this PR, feel free to ignore it if you want.
b5868ff
to
7810469
Compare
@simison While testing the code. The shotcode that generated the following html. I update the code to match the "old" shortcode id. Mostly because I didn't want to break existing behaviour. Since the previous shortcode had implemented a increment I also implemented in the new solution. The changes that I have also mean that we will need to update the .com code as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now works more as expected for me.
Hm, weird. I did test it with the shortcode block though, did you run the shortcode in different way? We can work out the backend side separately but let's get this in so that we have something in the next release. |
Looks good in my testing now for shortcode and videopress blocks: Core-video block extended with VideoPress does not have the ID, but I think we can leave that for a separate PR. We could first check if the publisher defined their own ID in the editor and use that; if not, provide our own fallback in the block attributes. Here's example markup for video block: <!-- wp:video {"id":436,"guid":"87dgjNyr","videoPressClassNames":"wp-block-embed is-type-video is-provider-videopress","title":"example-video-food-mp4"} -->
<figure class="wp-block-video wp-block-embed is-type-video is-provider-videopress"><div class="wp-block-embed__wrapper">
https://videopress.com/v/87dgjNyr?resizeToParent=true&cover=true&preloadContent=metadata&useAverageColor=true
</div></figure>
<!-- /wp:video --> |
Proposed changes:
Goes together with D161878-code, which adds the hash to URLs at emails:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Block
Add VideoPress block
Look at the page's HTML on frontend of the site, and note
id="jetpack-videopress-UNIQUE_ID"
is in HTML.Try adding block an ID from Block's settings panel, and note how that gets added to parent
<figure>
element just fine.Shortcode
Go to the WP media library, find the video, and copy the shortcode from its details page.
Add shortcode block, and use the videopress shortcode.
The HTML output should contain the ID.