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

Remove muted attribute from amp-video and its video fallback when autoplay is present #6581

Merged
merged 4 commits into from
Aug 30, 2021

Conversation

westonruter
Copy link
Member

This cherry-picks the PHP changes from #6547 to prevent an AMP validation warning from appearing when an amp-video > noscript > video element has autoplay while also muted attribute.

Copy link
Contributor

@pierlon pierlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@github-actions
Copy link
Contributor

Plugin builds for 8e93bd3 are ready 🛎️!

@westonruter westonruter merged commit a7e7992 into develop Aug 30, 2021
@westonruter westonruter deleted the bug/4635-disable-mute-when-autoplay-subset branch August 30, 2021 18:27
westonruter added a commit that referenced this pull request Aug 30, 2021
…en `autoplay` is present (#6581)

Co-authored-by: Dhaval Parekh <[email protected]>
@westonruter westonruter self-assigned this Aug 30, 2021
@westonruter
Copy link
Member Author

QA Passed

I added a Video block and enabled Autoplay and Muted:

image

No AMP validation warnings occur.

The muted attribute was omitted from the amp-video and video elements as expected:

<amp-video
		width="1280"
		height="720"
		autoplay=""
		controls=""
		src="https://wordpress-stable.lndo.site/wp-content/uploads/2021/08/SampleVideo_1280x720_1mb.mp4"
		layout="responsive"
		class="i-amphtml-layout-responsive i-amphtml-layout-size-defined"
		i-amphtml-layout="responsive">
	<i-amphtml-sizerstyle="display: block; padding-top: 56.25%"></i-amphtml-sizer>
	<a href="https://wordpress-stable.lndo.site/wp-content/uploads/2021/08/SampleVideo_1280x720_1mb.mp4" fallback="">https://wordpress-stable.lndo.site/wp-content/uploads/2021/08/SampleVideo_1280x720_1mb.mp4</a>
	<noscript>
		<video width="1280" height="720" autoplay controls src="https://wordpress-stable.lndo.site/wp-content/uploads/2021/08/SampleVideo_1280x720_1mb.mp4"></video>
	</noscript>
</amp-video>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants