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.
        var attributesCollection = sender.Attributes;
        attribute = attributesCollection.getItemByName("Title");
    // Display the Value of the MediaAttribute.
    if(attribute != null)
      alert("The title of the track is: " + attribute.value);

Community Additions