Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Value Property (MediaAttribute)

Gets the value of the MediaAttribute.

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

Property Value

string

The value of the MediaAttribute.

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

Community Additions

Show:
© 2015 Microsoft