![]() |
Previous | Next |
The attributeCount property retrieves the number of attributes associated with the playlist.
Syntax
player.currentPlaylist.attributeCount
Possible Values
This property is a read-only Number (long).
Remarks
Because playlists can come from many different sources, they can have several different sets of properties. This method retrieves the total number of properties available so that the other methods of the Playlist object can access them.
Example
The following sample is a JScript function that illustrates how various Playlist and Media properties and methods are used. The file that contains this function, and the skin definition file that displays the results, are included under ASX in the Samples directory that was installed with the SDK.
function onLoad() {
var display;
var pl = player.currentPlaylist;
pl.setItemInfo("custom playlist attribute", "changed");
pl.item(0).setItemInfo("new custom attribute", "5");
display = pl.attributeCount + " Playlist Attributes:\r\r";
for (var i = 0; i < pl.attributeCount; ++i) {
display = display + pl.attributeName(i) + ": ";
display = display + pl.getItemInfo(pl.attributeName(i)) + "\r";
}
for (var j = 0; j < pl.count; ++j) {
display = display + "\rTrack " + j + "\r"
display = display + pl.item(j).attributeCount + " Attributes:\r\r";
for (var k = 0; k < pl.item(j).attributeCount; ++k) {
var it = pl.item(j); // Media object
display = display + it.getAttributeName(k) + ": ";
display = display + it.getItemInfo(it.getAttributeName(k)) + "\r";
}
}
myText.value = display;
}
See Also
Previous | Next |