Export (0) Print
Expand All
Key
M11
M12
M21
M22
Tag
Uri
X1
X2
Y1
Y2
Expand Minimize

Value (MediaAttribute)

Silverlight

Gets the value of the MediaAttribute object.

value = object.Value
object.Value = value

Type: string

The value of the MediaAttribute.

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

The Name of a MediaAttribute object 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. In the following example, the MediaAttribute corresponds to the following ASX tag:

<Title>Clip1</Title>

In this example, the Name of the MediaAttribute is "Title" and the Value is "Clip1".

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

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);
    }
}

Community Additions

ADD
Show:
© 2014 Microsoft