Responsive videos: do not load when embed blocks are in use#11171
Responsive videos: do not load when embed blocks are in use#11171
Conversation
Fixes #11097 This is a different approach than #10880. Instead of shortcircuiting Jetpack responsive videos as soon as we detect that the theme supports core responsive embeds, we check the HTML content of each post for blocks. If we find blocks, and if we find embed blocks among those, we do not use Jetpack responsive videos. If however all we find are classic blocks (even with videos inside) or shortcodes, we carry on and use Jetpack responsive videos.
|
D23354-code. (newly created revision) |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: February 5, 2019. |
brbrr
left a comment
There was a problem hiding this comment.
This PR fixes the problem, but it seems that responsive-videos.min.js is still enqueued even when it is not needed.
|
@brbrr I have now updated this PR to take a different approach. I've updated the testing instructions accordingly. |
|
@laurelfulford Do you think you could give this a try, see if that solution would work for you? Thank you! |
|
@jeherve Gah, sorry I missed the ping from earlier this week to test! Looks like things are already moving ahead, but I wanted to confirm I did check this out, and the fix looks great! Thank you for diving into this! |
Fixes #11097
Changes proposed in this Pull Request:
This is a different approach than #10880. Instead of shortcircuiting Jetpack responsive videos as soon as we detect that the theme supports core responsive embeds, we hook into each block as it is being rendered. We check if the block is an embed block, and if so we remove the wrapper div that had been added by Jetpack Responsive videos, thus stopping it from affecting the display of videos.
If however all we find are classic blocks (even with videos inside) or shortcodes, we carry on and use Jetpack responsive videos.
Testing instructions:
jetpack-video-wrapperdiv around the embed. The video should take the full width of your browser.jetpack-video-wrapperdiv around the embed.Proposed changelog entry for your changes: