Windows Media Player Control SDK Banner Art
*Index  *Topic Contents
*Previous Topic: GetMediaInfoString
*Next Topic: GetMediaParameterName

GetMediaParameter Method

Retrieves the value of the specified parameter for an indexed Advanced Stream Redirector (ASX) entry.

Syntax

sRetVal = MediaPlayer.GetMediaParameter( lEntryNum, sName )

Parameters

lEntryNum Long value specifying the index number of an ENTRY element in the ASX file.
sName BSTR value specifying the NAME attribute of a PARAM element within the specified ENTRY element. This value is not case sensitive.

Return Value

Returns a String value representing the VALUE attribute of the specified PARAM element. This method returns a null value if lEntryNum is outside the range of the EntryCount property, or if no PARAM element within the specified ENTRY element has a NAME attribute equal to sName.

Remarks

The PARAM element allows you to place additional information into an ASX file, which the Microsoft® Windows Media™ Player control can then access through scripting. For example, you could insert the names of the producers of each media file inside the ASX file and display them in HTML somewhere near the Windows Media Player window.

Use this method to determine the values of the PARAM elements within an ASX ENTRY element. Call the GetMediaParameterName method to determine names associated with PARAM elements.

The first ENTRY element in an ASX file has an lEntryNum index number of 1. Index number 0 is reserved for child elements of the ASX tag, which applies to information valid for the entire show.

An example ASX file might look like the following.

<ASX VERSION="3.0">
    <TITLE>The Title of the Show<TITLE>
 
<ENTRY>    
    <REF HREF="YourMediaFilename.asf" />
    <TITLE>The Title of the Track</TITLE>
    <PARAM NAME="Producer" VALUE="Jane Doe">
</ENTRY>

</ASX>

To retrieve the producer information for the first entry, call the method as shown below.

MediaPlayer.GetMediaParameter( 1, "Producer");

This method call would return the string Jane D.

Note This scripting method is only available for the Windows Media Player version 6.01 and later. The standard installation of Microsoft® Internet Explorer 5 includes a compatible version of the Windows Media Player.

See Also

EntryCount, GetMediaParameterName


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