-
Notifications
You must be signed in to change notification settings - Fork 5
Description
All of gif, APNG, and AVIF do support a finite number of repeat count. While certainly an edge case, this might bring a couple of questions:
-
Should the duration be calculated based on the repeat count? E.g. a 3s gif with a repeat count of 3 would claim it's a 9s sequence. In that case, no-repeat and repeat infinitely would probably look the same, but maybe it's ok?
-
Currently
HTMLMediaElementonly has a booleanloopattribute. Should it get a count based one instead?
This latter question also brings the point of setting loop automatically: The explainer says it would be when the prefers-reduced-motion is off, but that might make the API more complex, e.g. what if an author does explicitly set the loop of the element in the same task they set the src?
One idea could be to treat infinitely looping sequences as a buffered stream1, when prefers-reduced-motion is off, and ignore the looping when on, so it would be the same as no-repeat in that case, and to respect the repeat count when finite for both cases which would simply affect the duration property.
And maybe autoplay can be kept off by default as it currently is, I don't think it can be authored in the file itself, and while it might be a slight DX improvement to have that behavior closely match <img>'s one, I'm not sure it's worth the specs trouble to handle the authored vs auto prop settings.
Footnotes
-
The difference between a "buffered" stream, like what we get with the
MediaSourceAPI, and a plain stream is that buffered ones can be seeked. ↩