HTML FAQ
I’ve set a video to autoplay, but it’s not playing automatically on iOS
For a video to autoplay on iOS, it needs to have both playsinline
and muted
attributes. If it still doesn’t autoplay, check that the phone is not in “Low Power Mode”, as iOS disables autoplay for all videos when this mode is active.
If I hardcode an image, should I upload it in several sizes to include them in the srcset and add sizes?
Depending on the image, if it’s an icon or a small image, it’s not necessary. If it’s a background image, we should optimize it as much as possible to avoid affecting performance. If it still weighs too much and we can scale it to select the most appropriate image for each breakpoint, the ideal approach would be to scale it and include srcset
and sizes
.