How Does the SMIL excl Timing Container Work?
The <excl> (exclusive) timing container in the
Synchronized Multimedia Integration Language (SMIL) defines a timeline
where only one child element can actively play at any given moment.
Unlike sequential (<seq>) or parallel
(<par>) containers, <excl> manages
concurrent media streams by interrupting, deferring, or halting running
elements whenever a new sibling element triggers. This mechanism
provides fine-grained control over interactive media presentations,
state-based UI components, and event-driven multimedia authoring.
Core Operational Mechanics
The fundamental rule of the <excl> container is
mutual exclusion. When a child element begins playback inside an
<excl> block, any currently playing sibling element
is immediately removed from active playback unless defined otherwise by
priority rules.
Unlike the <seq> container, which plays its
children in an automatic chronological order, child elements inside an
<excl> container do not activate sequentially by
default. Instead, each child element typically defines an explicit start
condition, such as a user interaction (like a click event) or a syncbase
reference tied to an external timeline. When an event fires, the target
element starts, and the SMIL runtime resolves the state of all other
sibling elements.
Priority Classes and Conflict Resolution
To control precisely what happens when an element attempts to
interrupt another, SMIL allows grouping children of
<excl> into <priorityClass>
elements. A priority class determines conflict resolution through three
primary attributes:
- peers: Defines how an incoming element interacts
with a currently active element of the same priority level. Possible
behaviors include
stop(the default, which halts the current element),pause(temporarily pauses the active element until the interrupting element completes),defer(queues the new element to play after the active one finishes), orignore(discards the incoming activation request). - higher: Dictates how an active element behaves when interrupted by an element of higher priority. Options mirror peer handling, allowing lower-priority media to pause and resume once high-priority alerts or cues conclude.
- lower: Dictates whether an incoming lower-priority
element can interrupt an active higher-priority element, typically
configured to
ignoreordefer.
When an interrupted element is configured with a pause
rule, SMIL maintains its presentation state. Once the interrupting child
finishes its duration, the paused element automatically resumes from its
exact suspension point unless its overall container duration has
expired.
Container Lifecycle and Termination
The lifecycle of an <excl> container depends on
standard SMIL timing attributes, including dur (explicit
duration) and endsync.
By default, an <excl> container continues to exist
as long as any of its children are playing or eligible to be activated
by unresolved events. Authors can set endsync="first",
endsync="last", or endsync="all" to control
whether the parent container shuts down after the completion of specific
child tracks or when all possible interactive paths are exhausted.