Compartir a través de


prevTrack Method

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

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.

Syntax

playList.prevTrack()

Return Value

No return value.

Remarks

Using this method on the first track in the playList causes that track to restart.

Example

<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>nextTrack and prevTrack Methods</TITLE>
<?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" begin="0;indefinite;"
    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>
</BODY>
</HTML>

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

Applies To

playList

See Also

Introduction to HTML+TIME, activeTrack, nextTrack