Which SMIL Attributes Set Transition Duration and Direction?
Synchronized Multimedia Integration Language (SMIL) provides specialized transition effects to blend media elements smoothly over time. Controlling the timing, speed, and geometric movement of these visual effects relies on a core set of dedicated XML attributes. This article explains the primary attributes used to define how long a SMIL transition lasts and the specific direction or pattern across the screen it follows.
Controlling
Duration with the dur Attribute
The length of time a transition takes to complete is primarily
governed by the dur attribute. When applied to a
<transition> element or directly to a media object
using transition filters, dur defines the active clock
duration of the visual change.
- Syntax and Values: The
durattribute accepts standard SMIL clock values, such as seconds (e.g.,dur="2.5s") or minutes and seconds (e.g.,dur="00:03"). - Behavior: If
duris omitted, the player defaults to the implementation-defined duration or inherits timing parameters from the parent timeline. Setting an explicitdurensures precise synchronization with accompanying audio or concurrent visual tracks.
Defining
Geometric Direction with subtype and
direction
SMIL splits direction control into two main attributes:
subtype for geometric orientation and
direction for the temporal progression of the wipe.
The subtype Attribute
While the type attribute defines the broad family of the
transition (such as barWipe, irisWipe, or
slideWipe), the subtype attribute specifies
the exact axis and vector of movement. Common values include:
leftToRightandrightToLeftfor horizontal wipes.topToBottomandbottomToTopfor vertical wipes.clockwiseandcounterClockwisefor radial transitions likeclockWipeorpinWheelWipe.cornersIn,cornersOut,topRight, orbottomLeftfor box and diagonal transitions.
The direction
Attribute
The direction attribute modifies the forward or backward
execution of the transition pattern. It accepts two primary values:
forward: The transition reveals the new media according to the standard geometric path defined by thetypeandsubtype. This is the default setting.reverse: The transition inverts the geometric progression, wiping the effect in the opposite direction without requiring a change to the underlyingsubtype.
Fine-Tuning
Boundaries with startProgress and
endProgress
To control partial transitions or alter where a directional movement
begins and ends, SMIL uses startProgress and
endProgress:
startProgress: Takes a fractional value between0.0and1.0defining the starting state of the transition (default is0.0).endProgress: Takes a fractional value between0.0and1.0defining the completion point (default is1.0).
Using these attributes alongside dur,
subtype, and direction allows developers to
truncate the path of a directional wipe or create faster, specialized
segment transitions across multimedia presentations.