3 ms·
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 Saf
by koolba 9y ago
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?
- cflat 9y agodon't need to remove the audio. it's muted by the browser. removing audio just saves bytes.
- floatingatoll 9y agoIncorrect. 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!
- cflat 9y agoin the context of <img> the audio track doesn't play anyway. dropping it ensures you save the bytes.
- floatingatoll 9y agoAn 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/ 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."