The repeatDur attribute specifies the length of time that
an element repeats before stopping. For example, a media
element that is five seconds long with a repeatDur attribute
20s plays four times and then stops. If an
element is still playing when the repeatDur attribute value
ends, the element stops, even if it has not repeated. Thus, when it
has a specified repeatDur attribute value, an element may
repeat many times, repeat for a fractional number of times, never
repeat, or play for a shorter time than its duration. You can use
this attribute to repeat a media element or a time container
element, such as a seq or excl element.
The repeatDur attribute can have the following values.
||Specifies the total duration of the repeated element. For information about valid time formats, see Time formats.|
||Specifies that the element should be repeated for an indefinite duration.|
If you want to base playback on the number of repetitions rather than on the duration, use the repeatCount attribute instead. Typically, you will use either the repeatDur attribute or the repeatCount attribute, but not both. If both are defined for the same element, the element will repeat for the duration specified in the repeatDur attribute and then repeat for the count specified in the repeatCount attribute.
In the following example, the repeatDur attribute causes the entire playlist, which contains an individual media element and an excl element, to repeat. Although this is not a practical example, it demonstrates how the repeatDur attribute works with elements.
First the media element named LogoGroove repeats for 15
seconds because it has a repeatDur attribute value of
15s. Then the media elements in the excl
container play through and repeat for 30 seconds because the
excl element has a repeatDur attribute value of
30s. Finally, the entire playlist repeats for a total
of three minutes. Given that the total duration of the playlist is
45 seconds, the playlist will repeat four times.
<?wsx version="1.0"?> <smil repeatDur="3:00"> <media id="LogoGroove" src="LG.wma" repeatDur="15s"/> <excl repeatDur="30s"> <media id="Introduction" src="Intro.wma" begin="0s"/> <media id="Sample" src="Sample.wma" begin="Introduction.end"/> </excl> </smil>
The repeatDur attribute can be specified for the following playlist elements: