Share via


Name Property (MediaAttribute)

Gets the name of the MediaAttribute.

XAML
Cannot be used in XAML. See ASX documentation for markup information.
Scripting
value = object.Name
object.Name = value

Property Value

string

The name of the attribute.

This property is read-only. There is no default value.

Remarks

The Name of a MediaAttribute is the name of the xml element in the ASX file that the MediaAttribute corresponds to. The Value of the MediaAttribute is the text value of the xml element. For example, if the ASX tag that the MediaAttribute corresponds to is:

<Title>Clip1</Title>

the Name of the MediaAttribute is "Title" and the Value is "Clip1".

Examples

The following JavaScript example shows how to retrieve the Attributes property of a MediaElement that has a Source property set to an ASX playlist file. The retrieved MediaAttributeCollection is iterated through and the Name and Value properties of each MediaAttribute is displayed.

JavaScript
function onMediaOpened(sender, args) {
    // Variable to hold the MediaAttribute.
    var attribute;
   
    // Get the MediaAttribute named Title
    try
    {
        var attributesCollection = sender.Attributes;
        attribute = attributesCollection.getItemByName("Title");
    }
    catch(errorObj)
    {
        alert(errorObj.message);
    }
    
    // Display the Value of the MediaAttribute
    if(attribute != null)
    {
      alert("The title of the track is: " + attribute.value);
    }
}

Applies To

MediaAttribute

See Also

Media Overview
MediaElement
MediaAttributeCollection
Attributes
MediaAttribute