|
File or Clip PropertiesWhen creating content, you can insert file properties, such as title, author, and copyright, directly into a Windows Media file, or you can insert the properties in the Windows Media metafile that is used to link to the content. Any properties that you enter in the metafile override those contained in the Windows Media file. You can also set properties for an entire playlist that contains multiple Windows Media streams. When you play the content, some properties are displayed on the Windows Media Player user interface, and others on the Windows Media Player Properties sheet. Here is an example of a playlist metafile that contains global playlist properties as well as properties for individual clips that are contained inside Entry elements. In this case, the properties are set using Abstract, Author, Banner, Copyright, MoreInfo, and Title elements.
The MoreInfo element adds functionality beyond simple text. In this example, MoreInfo elements add hyperlinks to the clip and show text on Windows Media Player. End users can click the text to link their browsers to Web sites that, for example, provide more information about an advertisement or music video. With Windows Media metafile scripting, you can add Banner elements to Windows Media Player as the stream plays. With this element you can place a banner (194 pixels wide x 32 pixels high) image on the Player at the bottom of the Video and Visualization pane. You can then add a hyperlink to the banner with a MoreInfo child element. In the example playlist, the Banner element in the first Entry element of the playlist displays an image in the banner bar of Windows Media Player just below the video display. The Banner element also contains MoreInfo and Abstract child elements that add a hyperlink and abstract text to the banner. Ad InsertionYou can send script commands in a stream that instruct Windows Media Player to cut away from the stream and play other streams or files according to scripting in a metafile. This scripting technique can be used for inserting advertisements in a stream. For example, during a live Internet broadcast of a ball game, a script command can be sent at the beginning of every commercial break, instructing each client (Windows Media Player) to play commercials listed in its metafile. When clients finish playing the commercials, scripting in the metafile instructs each client to cut back to the live broadcast. To take it a step further, Active Server Pages (ASP pages) and server-side scripting can be used to create metafiles on-the-fly for each client. So conceivably, by using metafile scripting, ad insertion could be personalized for each end user connecting to the ball game. Ad insertion is implemented using the Event element. The following example inserts the ad Advert.asf into the broadcast unicast stream BallGame when a client receives a script command with the Event type and the Time-Out parameter. When the ad is finished, the client resumes playing the previous entry.
PlaylistsPlaylists are powerful and flexible. With playlists, you can schedule content to play in succession, or you can insert advertising or special-interest clips into a presentation after a specific period of time or at a specific point. Windows Media Services and Windows Media Player work together to play the clips in a playlist with minimal buffering time or interruption between clips. The simplest playlists are created by adding multiple Entry elements to a metafile. Here's an example of a simple playlist:
Server or Protocol RolloverYou can use metafiles to provide a means of automatically switching to alternate content sources when a stream cannot be accessed or played for some reason. This is called rollover, and you can use it to specify alternate content on different servers or even different types of servers. You can, for example, specify a first alternate on a different Windows Media server. If that content fails to play, the client can rollover to a second alternate on a Web server:
Windows Media Services 9 Series can use RTSP, HTTP, or MMS for streaming. It uses RTSP when trying to connect to Windows Media Player 9 Series. If that attempt is unsuccessful, the server uses HTTP to connect to the Player. Earlier versions of the Player do not support RTSP, but they do support MMS. If the server cannot connect to the Player by using MMS, then the server tries to connect using HTTP. Windows Media Player automatically tries to rollover to different protocols according to its Windows Media property settings before trying the rollover URLs in the metafile. Putting It All TogetherHere's an example of a metafile that includes a variety of functionalities:
For More InformationTo learn more about metafiles, see the Windows Media metafile reference section on the MSDN Web site or download the Windows Media Player 9 Series Software Development Kit (SDK) from the Microsoft Web site. That SDK contains the metafile reference. Legal NoticeThis software is based in part on the work of the Independent JPEG Group. GIF decompression code, copyright 1990, David Koblas. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. |