Windows Media Player Control SDK Banner Art
*Contents *Index  *Topic Contents
*Previous Topic: Working with ASX Files
*Next Topic: Faceplate Authoring Guide

Using ASX Files for Seamless Stream Switching

You can use Advanced Stream Redirector (ASX) files to seamlessly switch between streams, or pieces of media content, by using the EVENT element in an ASX file in combination with OPENEVENT-type script commands from the encoder. Usually, when a piece of content ends, buffering occurs for the next clip or stream before it opens (if it is content received from streaming media server). Microsoft® Windows Media™ Services enables you to eliminate this buffering time and have another piece of streamed content begin playing nearly immediately. Seamless stream switching can only be implemented through the use of ASX files to access media content. The ASX file used must contain an EVENT element that defines a link to another piece of media content using an ENTRY element. The EVENT element must have a NAME attribute, which identifies the particular script command that comes from the encoder in the form Event eventname. When the EVENT-type script command is created or defined in the encoder, the parameter for the event is the name defined in the ASX metafile.

In order for seamless stream switching to take place, you must send a script command of type OPENEVENT with the name of the event as defined in the EVENT element in the ASX file. In the encoder you send a script command in the stream in the format OpenEvent eventname. When Microsoft® Windows Media™ Player receives an OPENEVENT-type script command from the encoder, it looks to the EVENT element in the ASX file and begins opening the piece of media content defined in the EVENT element. The Windows Media Player then holds this information until the actual event of the same name, in the format Event eventname is received. When the named event is received, the Windows Media Player seamlessly switches to that piece of media content, because it has already been opened and buffered.

For more information on using script commands, see the Windows Media Services tools documentation.


Top of Page Top of Page
© 1999 Microsoft and/or its suppliers. All rights reserved. Terms of Use.