Re:Evolution of <img>: Gif without the GIF
by koolba on Monday December 04, 2017 @12:02PM
(#15845364)
The article mentions removing the audio track. Is that required for this to work or would it play if it's included or is that just for efficiency? i.e. will Safari simply ignore it if it's included?
[ Parent
| on HN ]
Re:Evolution of <img>: Gif without the GIF
by floatingatoll on Monday December 04, 2017 @12:35PM
(#15845648)
An incomplete quote from the policy statement is below. I strongly encourage y'all to read the entire article, since there's more conditions than I'm pasting here, but these are the highlights that answer your question.
https://webkit.org/blog/6784/new-video-policies-for-ios/
"<video> elements will be allowed to autoplay without a user gesture if their source media contains no audio tracks."
"<video muted> elements will also be allowed to autoplay without a user gesture."
"If a <video> element gains an audio track or becomes un-muted without a user gesture, playback will pause."
Re:Evolution of <img>: Gif without the GIF
by cflat on Monday December 04, 2017 @12:07PM
(#15845414)
don't need to remove the audio. it's muted by the browser. removing audio just saves bytes.
Re:Evolution of <img>: Gif without the GIF
by floatingatoll on Monday December 04, 2017 @12:35PM
(#15845657)
Incorrect. If an audio track is present, the mp4 does not qualify for autoplay unless other conditions are met.
EDIT: Context is unclear about whether the parent's guidance is about <video> or <img>. No idea what <img> does. I sure hope it doesn't play due to the wasteful audio track, so that people are forced to do it right instead of lazy, though!