banner art

syncEvent attribute

The syncEvent attribute can be used to activate an element in a wrapper playlist from an element in a broadcast playlist that is being streamed from a publishing point.

Wrapper playlists are commonly used to deliver introductory content such as announcements and other information to the user before and/or after the requested content streams. The syncEvent attribute also enables you to insert wrapper playlists during user-requested content; for example, you can use a wrapper playlist to interrupt a broadcast with an advertisement and then return to the broadcast. The syncEvent attribute can be used to switch from a broadcast to a wrapper element and then switch back to the live broadcast.

Using the syncEvent attribute to activate an element in a wrapper playlist is a two-part process. First, you must select an element in the broadcast playlist that will activate the wrapper element. Then you must configure the wrapper playlist to respond to the event and interrupt the broadcast playlist. In the broadcast playlist, choose the element that will initiate the event and assign it a syncEvent attribute with a unique name, such as PlayEvent1. In the wrapper playlist, choose the element that will play when the event specified by the syncEvent attribute occurs. The element in the wrapper playlist must be a child element of an excl element for the server to be able to switch to the wrapper content properly.

Next you must configure the begin attribute of the wrapper playlist element to start at either the beginning or the end of the broadcast playlist element that initiates the syncEvent. For example, to start the wrapper playlist element after the broadcast playlist element PlayEvent1 ended, you would use the following syntax:

begin="PlayEvent1.end"

Additionally, if you want the broadcast playlist to resume playback after the wrapper playlist ends, ensure that the wrapper element is contained in a priorityClass element with a peers attribute value of pause.

The syncEvent attribute value can only be used with broadcast publishing points. Keep in mind that the broadcast publishing point runs independently of the wrapper playlist. As the wrapper element plays, the broadcast playlist continues to run. Therefore, you may need to consider how to maintain synchronization when using a syncEvent attribute. For example, if you plan to switch from a broadcast to a 60-second wrapper announcement, you may want to insert a 60-second placeholder file in the broadcast playlist, so that the broadcast playlist will resume at the right time. Note that clients that connect to the publishing point while the wrapper element is playing will not receive the wrapper content. Your placeholder file should provide the user with something besides silence or a blank screen and indicate that the content will resume eventually.

The following two sample playlists provide an example of a syncEvent attribute implementation. The first playlist is the source for a broadcast publishing point; the second is the associated wrapper playlist. The second media element in the broadcast playlist contains a syncEvent attribute with a value of Wrap. When that media element becomes active, the associated wrapper playlist is searched for an element with a begin or end attribute value equal to Wrap.

<?wsx version="1.0"?>
<smil>
	<media src="ProgSegment1.wmv"/>
	<media src="Bumper.wmv" syncEvent="Wrap"/>
	<media src="Break1.wmv" dur="30s"/> 
	<media src="ProgSegment2.wmv"/>
</smil>

The second media element in the following wrapper playlist has a begin attribute value of Wrap.end. Therefore, when the broadcast playlist media element Bumper.wmv activates the syncEvent attribute, the corresponding wrapper element plays back after Bumper.wmv ends. Because the media element LocalAd.asp is contained in a priorityClass element that has a peers attribute value equal to pause, the broadcast playlist resumes playback after the wrapper playlist element finishes.

<?wsx version="1.0"?>
<smil>
	<excl>
		<priorityClass peers="pause">
			<media src="%requestedUrl%" begin="0s"/>
			<media src="httpd://webserver1/localad.asp" begin="Wrap.end"/>
		</priorityClass>
	</excl>
</smil>

In the following example, the publishing point source is a playlist that references a broadcast stream from an encoder. When the encoder sends a script command to the server containing the type FIRE_EVENT and the value PlayEvent, the media element named Bmp becomes active and the syncEvent attribute value of Wrap signals the wrapper playlist to begin streaming. When Bmp ends, the wrapper playlist streams to the client while the server-side playlist continues with the media element named Break. Assuming the wrapper element is a 30-second advertisement, the broadcast playlist resumes playback of the live encoder stream after the wrapper element ends.

<?wsx version="1.0" ?>
<smil>
   <excl>
	<priorityClass peers="pause">
		 <media id="Live" src=http://encoder:8080 begin="0s"/>
		 <media id="Bmp" src="Bumper.wmv" begin="PlayEvent"
		syncEvent="Wrap"/>
		 <media id="Break" src="break1.wmv" begin="Bmp.end" dur="30s"/>
	</priorityClass>
   </excl>
</smil>

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

Note Image Notes

Related topics


© 2005 Microsoft Corporation. All rights reserved.