How Does dur="indefinite" Work in SMIL?

In Synchronized Multimedia Integration Language (SMIL), assigning dur="indefinite" specifies that an element's simple duration has no predefined mathematical boundary and will persist until explicitly terminated. While a standard clock value defines a deterministic runtime, an indefinite duration shifts lifecycle management to external triggers, explicit end conditions, or parent container boundaries. This mechanism allows animations, audio, video, and structured content blocks to remain active until user interaction, scripted DOM calls, or document hierarchy constraints resolve their active duration.

The Role of Simple Duration

Within the SMIL timing model, the dur attribute defines the simple duration of an element—the unrepeated, baseline span of time required for the element to run through its presentation cycle. When dur="indefinite" is applied, the simple duration is evaluated as infinite.

Unlike bounded intervals (such as dur="5s"), an indefinite simple duration never completes a natural cycle on its own:

Resolving Active Duration with End Conditions

An element with an indefinite simple duration does not necessarily play forever. SMIL distinguishes between simple duration (the intrinsic length of the media/animation) and active duration (the actual span of time the element is active in the document timeline).

Active duration is determined by combining begin, dur, end, and container bounds. To terminate an element defined with dur="indefinite", SMIL relies on explicit end conditions specified via the end attribute:

If an element has dur="indefinite" and no end attribute, event trigger, or container constraint, its active duration remains infinite.

Behavior Within Sequential and Parallel Containers

The lifecycle of an indefinite element depends heavily on the time container enclosing it:

Parallel Containers (<par>)

In a <par> container, child elements execute concurrently. If a child element has dur="indefinite", the default container ending rule (endsync="last") causes the <par> container itself to remain active indefinitely unless the indefinite child is explicitly ended or the container defines an explicit dur or end. If the container uses endsync="first", the indefinite element terminates as soon as the shortest bounded sibling completes.

Sequential Containers (<seq>)

In a <seq> container, elements execute one after another in document order. A child element with dur="indefinite" blocks all subsequent siblings from starting because the current element never reaches a natural end point. Subsequent siblings only activate if the indefinite element is ended via an explicit trigger or event.

Post-Active State and the fill Attribute

When an element with dur="indefinite" is finally terminated by an external event or parent boundary, SMIL evaluates the fill attribute to dictate rendering behavior: