role

banner art

Previous Next

role

The role attribute specifies the type or purpose of a media element.

Syntax

  role= String-value

Remarks

The WMS SMIL Playlist Parser plug-in enforces case sensitivity on the role attribute.

This attribute is a Microsoft extension to SMIL 2.0. It enables you to specify the role of a media element. Any text string is valid. Examples are Movie, Advertisement, Clip, and so on.

The server copies the value specified for the role attribute to the WMS_PRESENT_PLAYLIST_ENTRY_ROLE value of the presentation context and to the cs-media-role log field in the WMS_COMMAND_CONTEXT_BODY value of the command context. Logging plug-ins such as the WMS Client Logging plug-in can retrieve the value and write it to a file. For more information about log fields, see Log Data Format.

When the value of role is set to "Advertisement", the server will update the ad counters. You can use the IWMSServerTotalCounters::get_Advertisements or IWMSPublishingPointTotalCounters::get_Advertisements method to retrieve the cumulative number of advertisements streamed from a playlist. However, if the media element to which the advertisement role is assigned does not reference a media stream or file, the counters are not updated.

Example Code

In the following wrapper playlist, the ad counters are updated when the server starts to stream ad_1.wmv and ad_2.wmv.

<?wsx version="1.0"?>
<smil>
    <media src= "c:\wmpub\wmroot\ad_1.wmv" role="Advertisement" />
    <media src="%RequestedURL%"
    <media src= "c:\wmpub\wmroot\ad_2.wmv" role="Advertisement" />
</smil>
  • Note   For more information about the SMIL 2.0 Specification, W3C Recommendation, see the W3C Web site.

Web addresses can change, so you might be unable to connect to the Web site or sites mentioned here.

See Also

Previous Next