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

Attributes

Silverlight

Gets the collection of MediaAttribute objects that corresponds to the current entry in the ASX file that Source is set to.

value = object.Attributes

Type: MediaAttributeCollection

The collection of MediaAttribute objects.

This property is read-only. The default value is an empty collection.

Attributes are generally populated on a per-source basis and will not be valid until a source is loaded.

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 are displayed.

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:
© 2015 Microsoft