-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[AWS Diagram] Optimize GIF assets with MP4/WebM videos #8152
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import React from "react"; | ||
|
|
||
| const AutoVideo = ({ | ||
| mp4, | ||
| webm, | ||
| width, | ||
| height, | ||
| alt = "", | ||
| className, | ||
| style, | ||
| }) => { | ||
| return ( | ||
| <video | ||
| autoPlay | ||
| muted | ||
| loop | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Provide a way to pause the looping videos. These videos autoplay and loop, but the component exposes no controls. Visitors cannot pause a demonstration while reading the adjacent content. Add native 🤖 Prompt for AI Agents |
||
| playsInline | ||
| preload="none" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift Defer video loading until each demonstration is near the viewport.
🤖 Prompt for AI Agents |
||
| width={width} | ||
| height={height} | ||
| aria-label={alt} | ||
| className={className} | ||
| style={style} | ||
| > | ||
| {webm && <source src={webm} type="video/webm" />} | ||
| {mp4 && <source src={mp4} type="video/mp4" />} | ||
| </video> | ||
| ); | ||
| }; | ||
|
|
||
| export default AutoVideo; | ||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Disable automatic playback when reduced motion is requested.
autoPlaystarts these demonstrations even when the visitor requests reduced motion. That leaves motion-sensitive visitors exposed to four looping videos. Checkprefers-reduced-motionbefore starting playback, and show a still frame with an explicit play option for those visitors. (developer.mozilla.org)Based on learnings, frontend animation must honor
prefers-reduced-motion.🤖 Prompt for AI Agents
Source: Learnings