Share via


Repeating Streams

You can use the repeatDur and repeatCount attributes to repeat media elements. You can use repeatDur to specify the amount of time that an element repeats, and you can use the repeatCount attribute to specify the number of times that an element repeats. The repeatDur attribute supports fractional values, but the repeatCount attribute rounds fractional values up.

The following example illustrates nested repeats. Assume that the actual length of each clip is 29 seconds. The playing order is:

  1. When the first seq block, s1, executes, clip1.wmv plays twice for a total of 58 seconds and clip2.wmv plays three times for a total of 187 seconds.

  2. When s1 repeats, clip1.wmv again plays twice and clip2.wmv three times. The total duration of the repeated elements in the first seq block is 290 seconds ( equals 2*(58+87) ).

  3. When the second seq block, s2, executes, clip3.wmv is played four times and clip4.wmv is played twice.

  4. When s2 repeats, clip3.wmv again plays four times and clip2.wmv twice.

<?wsx version="1.0"?>
<smil>
  <seq>
     <!-- This seq plays twice using repeatDur. -->
     <seq id="s1" repeatDur="290">

        <!-- Plays 2 times. -->
        <media id="s1-m1" repeatDur="58" src="c:\wmpub\wmroot\clip1.wmv" />

        <!—- Plays 3 times. -->
        <media id="s1-m2" repeatDur="87" src="c:\wmpub\wmroot\clip2.wmv" />
     </seq>

     <!-- This seq repeats twice using repeatCount. -->
     <seq id="s2" repeatCount="2">

        <!-- Plays 4 times. -->
        <media id="s2-m1" repeatCount="4" src="c:\wmpub\wmroot\clip3.wmv" />

        <!-- Plays 2 times. -->
        <media id="s2-m2" repeatCount="2" src="c:\wmpub\wmroot\clip4.wmv" />
     </seq>
  </seq>

</smil>

See Also

Concepts

Using XML to Define Playlists