How Does SMIL priorityClass Regulate Interruptions?
In Synchronized Multimedia Integration Language (SMIL), the
<priorityClass> element defines explicit
conflict-resolution and interruption policies for sibling elements
inside an exclusive container (<excl>). By grouping
media elements into priority tiers and assigning specific interruption
behaviors, authors can control whether an active element halts, pauses,
ignores, or defers when another element attempts to start.
The Role of
<excl> and Priority Grouping
The <excl> container specifies that only one child
element may play at a time. While a basic <excl>
relies on default startup rules to resolve playback collisions, modern
multimedia presentations often require nuanced behavior. For instance,
high-priority media like urgent audio alerts should interrupt ambient
background narration, whereas lower-priority background sounds should
not disrupt essential playback.
The <priorityClass> element addresses this need by
organizing children inside <excl> into hierarchical
groups. Elements placed in a higher-priority class take precedence over
elements in lower-priority classes, while elements within the same class
follow peer-level interruption rules.
Core Interruption Attributes
Interruption behavior is governed by three core attributes attached
to the <priorityClass> element:
peers: Determines what happens when an element in the current<priorityClass>attempts to start while another element in the same class is currently playing.higher: Specifies how elements in this priority class react when an element from a higher-priority class attempts to start.lower: Specifies how elements in this priority class react when an element from a lower-priority class attempts to start.
Interruption Actions: Stop, Pause, Defer, and Never
Each of the three control attributes accepts specific action values that dictate playback state transitions:
stop: The currently playing element is immediately terminated and removed from the active timeline when interrupted.pause: The currently playing element pauses its presentation and retains its state. When the interrupting element finishes, the paused element resumes playback unless explicitly prevented by timing rules.defer: The incoming element is queued rather than starting immediately. It waits until the active element completes before beginning its playback cycle.never: The incoming element is completely rejected and ignored, allowing the currently active element to continue uninterrupted.
Practical Application and Execution Flow
When an event triggers a child media element inside an
<excl>, the SMIL engine evaluates the priority level
of the incoming media against the active media:
- Incoming Media from a Higher Priority Class: The
engine checks the
higherattribute of the active element's priority class. If set topause, the active element freezes while the higher-priority media plays, resuming automatically once the higher-priority event concludes. - Incoming Media from a Lower Priority Class: The
engine consults the
lowerattribute of the active class. If set tonever, the incoming lower-priority request is discarded, protecting high-value content from lower-level interruptions. - Incoming Media within the Same Class: The engine
applies the
peersattribute rule to resolve the conflict between elements of equal priority.
Through the combination of tiered classes and attribute
configurations, the <priorityClass> element
transforms <excl> from a simple mutually exclusive
switch into a deterministic scheduling engine for complex, interactive
multimedia.