SMIL in Parallel

Objects in the <par> element will be displayed simultaneously (in parallel).

Parallel element <par>

The <par> element has many attributes. The most commonly used attributes are:

Attribute Value Description
begin time Set the delay before the element is displayed.
dur time Set the duration of the display.
endsync "first"|"last"|id(clip) Stopping of synchronization elements.
repeatCount number Set the number of times the display is repeated.

For a complete list of SMIL elements and attributes, please visit CodeW3C.com SMIL Reference Manual.

Synchronization (Synchronization )

By using in the <par> tag endsync Properties, the parallel group of segments can stop simultaneously.

endsync="first" The group <par> will stop all segments, regardless of how the time parameters of other segments are set, when the shortest segment ends.

endsync="last" The group <par> will terminate when all segments have finished playing. This is the default behavior.

endsync="id(ID)" The <par> group will end when the marked (ID) segment ends. This ID will refer to the value of the id attribute of the segment.

Example: Display Simultaneously

<html xmlns:t="urn:schemas-microsoft-com:time">
<head>
  <?import namespace="t" implementation="#default#time2">
  <style>.t {behavior: url(#default#time2)}</style>
</head>
<body>
<par>
<t:audio
src="liar.wav"
repeatCount="indefinite"
type="wav" />
<t:seq repeatCount="indefinite">
  <h2 class="t" dur="1s">
  I will display for one second</h2>
  <h2 class="t" dur="2s">
  I will display for two seconds</h2>
</t:seq>
</par>
</body>
</html>

Try It Yourself (TIY)