speed property

Gets the playback speed of an element at run time, which includes the cascading effect of the speed set for the parent time container.


speed = object.speed

Property values

Type: Floating-point

the runtime speed of an element.


The value of this read-only property reflects the speed settings inherited by the element from its parent time container. For example, if the speed property of the parent time container for an element is set to 0.5 and the speed property of the element is set to 0.5, the element plays back at 25 percent of its usual playback speed. In other words, the parent plays at 50 percent speed, and the child plays at 50 percent of the parent speed, yielding a 25 percent playback speed for the child.


The following example accesses the speed property of an element at run time. Click the buttons to see the difference between the speed of the video element and the value of the speed property exposed by the currTimeState object. In this case, the speed value is the product of speed settings for the element and its parent.

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

<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
<TITLE>speed Property</TITLE>
    .time{ behavior: url(#default#time2);}
<?IMPORT namespace="t" implementation="#default#time2">

<t:PAR id="p1" SPEED="2" >
<t:VIDEO id="v1" BEGIN="1" style="position:absolute; top:80px; left:20px;

<BUTTON class="time" style="position:absolute;top:200px" repeatCount="indefinite" 
    onclick="alert('Run time speed: ' +  v1.currTimeState.speed);">
    Run time speed</BUTTON>
<BUTTON class="time" style="position:absolute;top:200px;left:150px" 
repeatCount="indefinite" onclick="alert('Video element speed: ' + v1.speed);">
Video element speed</BUTTON>


See also


Introduction to HTML+TIME