Share via


Specifying Begin and End Times

banner art

Previous Next

Specifying Begin and End Times

You can use the begin and end attributes to specify the time at which a media element becomes active and stops relative to the start of the parent time container. This is illustrated by the following example. The second media element, m2, begins when the time container starts and ends 20 seconds later. The first media element, m1, begins when m2 stops and plays for 40 seconds.

<?wsx version="1.0"?>
<smil>
  <excl >
    <media id="m1" src="clip1.wmv" begin="20" end="40" />
    <media id="m2" src="clip2.wmv" begin="0" end="20" />
  </excl>
</smil>

You can also use the clipBegin attribute to identify the start time of a media element relative to the beginning of the media file. This enables you to start streaming content without starting at the beginning of the file. Similarly, the clipEnd attribute specifies the end of the media element relative to the start of the media file. The syntax is illustrated in the following examples.

<?wsx version="1.0"?>
<smil>
  <seq>
    <media src="c:\wmpub\wmroot\audio1.wma" clipBegin="2:42" />
    <media src="c:\wmpub\wmroot\audio2.wma" clipBegin="0:00" />
    <media src="c:\wmpub\wmroot\audio3.wma" clipBegin="2min" />
    <media src="c:\wmpub\wmroot\audio4.wma" clipBegin="0h" dur="30" />
  </seq>
</smil>

<?wsx version="1.0"?>
<smil>
  <seq>
    <ref src="c:\wmpub\wmroot\clip1.wmv" clipEnd="0:30" />
    <ref src="c:\wmpub\wmroot\clip2.wmv" clipEnd=":30" />
    <ref src="c:\wmpub\wmroot\clip3.wmv" clipEnd="2min" />
    <ref src="c:\wmpub\wmroot\clip4.wmv" clipEnd="4:40" />
    <ref src="c:\wmpub\wmroot\clip5.wmv" clipEnd="0h" />
  </seq>
</smil>

See Also

Previous Next