What Does the SMIL begin Attribute Specify?
The begin attribute on a Synchronized Multimedia
Integration Language (SMIL) timed media element specifies the exact
moment when the element becomes active and starts its presentation or
playback. By defining when media such as video, audio, or animation
begins relative to a timeline, user interaction, or sibling elements,
the begin attribute acts as a core mechanism for
synchronizing complex, multi-track multimedia layouts across web
standards and SMIL-based animation formats like SVG.
Core Function of the begin Attribute
In SMIL timing architectures, every timed element possesses an active
timeline. The begin attribute explicitly controls the start
of this timeline by accepting one or more timing values (separated by
semicolons). When the designated trigger or timestamp evaluates to true,
the player transitions the media element from an inactive state to an
active playing state. If the attribute is omitted, the default value
typically resolves to 0s, causing the element to play
immediately when its parent synchronization container starts.
Supported Timing Value Types
The begin attribute supports a wide variety of timing
specifications to handle static schedules as well as dynamic runtime
events:
- Clock Values (Offsets): Explicit time
representations specifying an offset relative to the document or parent
container's start (for example,
begin="5s"orbegin="01:30"). - Syncbase Values: Relative timing based on the start
or end of another timed element by referencing its ID (for example,
begin="video1.end"orbegin="intro.begin+2s"). - Event Values: Triggers fired by DOM or
user-interaction events (for example,
begin="button.click"orbegin="mouseenter"). - Wallclock Values: Real-world date and time
definitions using standard clock syntax (for example,
begin="wallclock(2026-09-01T09:00:00Z)"). - Repeat Values: Triggers based on the iteration
cycle of another looping element (for example,
begin="anim1.repeat(2)"). - Indefinite: Defines that the element will not start
automatically on a timeline and must be triggered externally via
scripting methods like
beginElement()(usingbegin="indefinite").
Interaction and List Processing
When multiple begin conditions are declared as a semicolon-separated
list (for example, begin="click; prevMedia.end+5s"), the
SMIL engine evaluates each condition independently. The element
activates whenever any of the listed conditions are met, allowing for
flexible playback controls that respond to both scheduled timelines and
real-time user input.