-
Notifications
You must be signed in to change notification settings - Fork 823
VideoPress: Prevent videopress blocks autoplaying inside iframe previews #44295
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
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 🤖 Follow this PR Review Process:
If you have questions about anything, 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. |
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
3ec4bfc
to
9cbeadb
Compare
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.
Tested:
✅ VideoPress block
✅ core/video block
} | ||
|
||
if ( $block['blockName'] === 'core/cover' && $block['attrs']['backgroundType'] === 'video' ) { | ||
$block_content = self::change_element_src_query_param( $block_content, array( 'class_name' => 'wp-block-cover__video-background' ), 'autoPlay', '0' ); |
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.
I think it autoplays with muted by default. It might be fine to leave it as is 🤔
I'm closing this in favour of the approach in 187730-ghe-Automattic/wpcom |
Part of DOTDASH-137
Proposed changes:
muted
andautoplay
attributes during renderOther information:
Jetpack product discussion
The video shortcodes are already being prevented from autoplaying in an iframe preview. So by the same logic the videopress block should also
The
?iframe=true&preview=true
logic isn't bullet proof. Theoretically a used could choose to use these query params too on their front end. But it is safe to change behaviour based on these flags becauseDoes this pull request change what data or activity we track or use?
No
Testing instructions:
Testing Simple and VideoPress
?iframe=true&preview=true
query paramshttps://wpcalypso.wordpress.com/v2
and find your site in grid viewhttps://wordpress.com/home/{{ your test site }}
Testing Atomic and VideoPress
Use The Jetpack beta plugin do the same tests on an atomic site
Testing Atomic and core/video
/wp-admin/admin.php?page=jetpack#/dashboard
core/video
block, using your fresh video file?iframe=true&preview=true
query paramsOther blocks to test
core/video
block that is pointing at a video press filecore/cover
block which is using a video background[wpvideo asdfksda]
shortcode