Partilhar via


playList Collection

This topic documents a feature of HTML+TIME 2.0, which is obsolete as of Windows Internet Explorer 9.

Retrieves a collection of playItem objects.

Syntax

[ oColl = ] object.playList
[ oObject = ] object.playList(iIndex)

Possible Values

oColl Array of elements contained by the object.
oObject Reference to an individual item in the array of elements contained by the object.
iIndex Required. Integer that specifies the zero-based index of the item to be returned.

Members Table

The following table lists the members exposed by the playList object.

Property Description
activeTrack

Sets the active track or gets the active playItem object in the playList collection.

dur

Gets the playing-time length of the current playList or playItem, if the length is known.

length

Gets the number of objects in a collection.

Method Description
item

Retrieves the playItem object at the specified index from the current playList collection.

nextTrack

Advances the media-playing container to the next playItem object in the playList collection and begins playing that track.

Advances the media-playing container to the next playItem object in the playList collection and begins playing that track.
prevTrack

Sets the media-playing container to the previous playItem object in the playList collection and begins playing that track.

Sets the media-playing container to the previous playItem object in the playList collection and begins playing that track.
Object Description
playItem

Represents an individual media file in a playList collection.

Remarks

Some media file formats contain several individual media files, such as an MPEG-Layer 3 (MP3) playlist that contains several MP3 files. This collection provides access to those individual media files.

The playList collection is available only while the parent element is active on the timeline. When the parent element's timeline ends, this collection is no longer available.

Example

This example demonstrates how to retrieve a collection of playItem objects using the playList collection.

<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
    .time{ behavior: url(#default#time2);}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
function updateBtns() {        
    if(m1.currTimeState.isActive){
        b0.disabled=true;
        b1.disabled=false;
        b2.disabled=false;
        b3.disabled=false;
    }else{
        b0.disabled=false;
        b1.disabled=true;
        b2.disabled=true;
        b3.disabled=true;
    }
}
function updateFields(){
    title1.innerText = 'Title: ' + m1.playList.activeTrack.title;
    author1.innerText = 'Author: ' + m1.playList.activeTrack.author;
    abstract1.innerText = 'Abstract: ' + m1.playList.activeTrack.abstract;
    copyright1.innerText = 'Copyright: ' + m1.playList.activeTrack.copyright;
}
function emptyFields(){
    title1.innerText = 'Title: ';
    author1.innerText = 'Author: ';
    abstract1.innerText = 'Abstract: ';
    copyright1.innerText = 'Copyright: ';
}
</SCRIPT>
</HEAD>

<BODY onload="updateBtns()" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED"
    BGCOLOR="#FFFFFF" LINK="#000000"    VLINK="#808080" ALINK="#000000">
...
<t:media id="m1" src="/workshop/samples/author/behaviors/media/media.asx"
    onmediacomplete="updateFields();updateBtns();"/>

<SPAN id="title1">Title:</SPAN><BR>
<SPAN id="author1">Author:</SPAN><BR>
<SPAN id="abstract1">Abstract:</SPAN><BR>
<SPAN id="copyright1">Copyright</SPAN><BR><BR>

<BUTTON id="b0" onclick="m1.beginElement();updateFields();updateBtns();">Start</BUTTON>
<BUTTON id="b1" onclick="m1.playList.nextTrack();updateFields();">Next Track</BUTTON>
<BUTTON id="b2" onclick="m1.playList.prevTrack();updateFields();">Previous Track</BUTTON>
<BUTTON id="b3" onclick="m1.endElement();emptyFields();updateBtns();">Stop</BUTTON>
<BR><BR>

</BODY>
</HTML>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/playlist.htm

Applies To

t:AUDIO, t:MEDIA, t:REF, t:VIDEO

See Also

Introduction to HTML+TIME