banner art

begin attribute

The begin attribute specifies the timing value used to start or activate an element.

The begin attribute works differently depending on the element it is used with. If used with a media element, the begin attribute value specifies when the content source begins playing.

Child elements of seq or smil elements begin automatically and play sequentially, so they do not require a begin attribute value to start. You can add a begin value if you do not want an element in a seq or smil container to start immediately after the previous element. Offset values are the only supported timing values for child elements of seq or smil containers, and the value for the begin attribute must be positive.

The begin attribute is most useful for activating elements in excl or priorityClass elements. Unlike the immediate children of seq or smil containers, child elements of an excl or priorityClass element have no default start time, and will therefore not start without a begin attribute value.

An element can be activated relative to the timing of other elements in the playlist or by a server event. You can use the begin attribute with a list of semicolon-delimited event values to identify multiple times when the element should be played; for example begin="event1;event2;event3". Negative time values and time values that are shorter in duration than the length of the element are ignored. For complete information about the supported begin attribute values, see Timing values.

In the following example, the media element Intro.wma starts the playlist because it has begin attribute value of 0s. When a begin attribute value uses an offset timing value without a SyncBase timing value, such as in this example, the currently active element (excl) is the implied SyncBase, or point of time reference. When the playlist starts, the excl element becomes the first active element because it has a media element that has a begin value of 0s.

Ten seconds into the playlist named Prog, the third media element in the priorityClass element, interrupts playback of Intro.wma because it has a begin attribute value of 10s. After Prog has played for 10 seconds, the media element Comml1 interrupts because it has a begin attribute value of prog.begin+10s. Note that Comml1 has a begin attribute value that is relative to the media element Prog instead of relative to the time container. Similarly, when Comml1 ends, Comml2 plays because it has a begin attribute value of comml1.end. Because the priorityClass element has a peers attribute value of pause, Prog will continue playing when Comml2 ends.

<?wsx version="1.0"?>
<smil>
	<excl>
		<media src="Intro.wma" begin="0s"/>
		<priorityClass peers="pause">
			<media id="Comml1" src="Commercial1.wma"
			 begin="prog.begin+10s"/>
			<media id="Comml2" src="Commercial2.wma"
			 begin="comml1.end"/>
			<media id="Prog" src="Program.wma" begin="10s"/>
		</priorityClass>
	</excl>
</smil>

The begin attribute can be specified for the following playlist elements:

Note Image Notes

Related topics


© 2005 Microsoft Corporation. All rights reserved.