HTML+TIME: Time Containers

Internet Development Index

By providing a timing model that unifies a rigid timeline with event-based timing relationships, Introduction to HTML+TIME makes it easy to synchronize media elements, control animations, and add interactive timed content to a Web page without using script. For example, authors can apply and remove styles to elements over time, synchronize user-fired elements with the document timeline, and handle delays in media file playback.

The following links provide access to the object model exposed by the time2 behavior.

Overviews

Seeking With HTML+TIME

In HTML+TIME (Timed Interactive Multimedia Extensions) various types of media, animation, and other time elements can be played over a period of time. It is often desirable to be able to jump to any point on this time line. This process of jumping to different points on a time element's time line is called seeking.

Using the HTML+TIME Document Object Model (DOM)

All HTML+TIME objects are accessible through script at run time. This article introduces you to the HTML+TIME objects, methods, events, and properties available to your Web pages.

Tutorials

Incorporate the time2 Behavior

This tutorial explains how to incorporate the time2 behavior in your Web pages so you can begin using timelines, multimedia, and animation with HTML elements.

Time Containers and Objects

currTimeState

Contains information about an HTML+TIME timeline.

excl

Defines a time container that allows only one child element to play at any given time.

par

Defines a new timeline container in an HTML document for independently timed elements.

priorityClass

Defines a group of excl children and the pause/interrupt behavior of the children.

seq

Defines a new timeline container in an HTML document for sequentially timed elements.

Attributes and Properties

accelerate

Sets or retrieves a value that applies an acceleration to an element's timeline.

activeDur

Retrieves the total duration of the timeline.

activeTime

Retrieves the current point in time along the total active timeline, including repeats and time spent in reverse mode.

autoReverse

Sets or retrieves whether the timeline on an element begins playing in reverse immediately after completing in the forward direction.

begin

Sets or retrieves the delay time before the timeline begins playing on the element.

decelerate

Sets or retrieves a value that applies a deceleration to the end of a simple duration.

dur

Sets or retrieves a value indicating the amount of time the element remains active or displayed.

end

Sets or retrieves a value indicating the end time for the element, or the end of the simple duration when the element is set to repeat.

endSync

Sets or retrieves the synchronization rule that specifies which child element is used to determine when the time container will end.

fill

Sets or retrieves the action an element takes if its timeline ends before the timeline on its parent element ends.

isActive

Retrieves a value that indicates whether the element is currently active on the timeline.

isOn

Retrieves a value that specifies whether the element is active or holding on the timeline in its current state.

isPaused

Retrieves a value that specifies whether the element is paused on the timeline.

length

Retrieves the number of objects in a collection.

parentTimeBegin

Retrieves the current element's begin time as an offset from the parent element's begin time.

parentTimeEnd

Retrieves the current element's end time as an offset from the parent element's begin time.

progress

Retrieves the current progress of the element's timeline.

repeatCount

Retrieves the current iteration in the repetition loop.

repeatCount

Sets or retrieves the number of times an element's timeline repeats.

repeatDur

Sets or retrieves the number of seconds that an element's timeline repeats.

restart

Sets or retrieves the conditions under which an element can be restarted on a timeline.

segmentDur

Retrieves the duration of an element on a timeline in seconds, including autoReverse.

segmentTime

Retrieves the current point in time along a segment of time.

simpleDur

Retrieves the duration of a repeat iteration.

simpleTime

Retrieves an object's current point along its timeline from zero to its dur value.

speed

Sets or retrieves the playback speed of an element relative to its parent time container.

speed

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

state

Retrieves the current state of the element's timeline.

stateString

Retrieves the current state of the element's timeline.

syncBehavior

Sets or retrieves a value that indicates the synchronization rules for the element's timeline.

syncMaster

Sets or retrieves whether the time container must synchronize playback to this element.

syncTolerance

Sets or retrieves the time variance allowed on a timeline with locked synchronization.

timeAction

Sets or retrieves what action is taken on the element while the timeline is active.

timeContainer

Sets or retrieves the type of timeline associated with an element.

timeParent

Retrieves the parent time container element of the current element.

volume

Sets or retrieves the volume of the media file.

Methods

activeTimeToParentTime

Converts a value in the element's active timeline to the corresponding point in the parent timeline.

activeTimeToSegmentTime

Converts a value in the element's active timeline to the corresponding point in the segment timeline.

beginElement

Starts the element on the timeline.

beginElementAt

Starts an element's timeline at the specified time.

documentTimeToParentTime

Converts a value in the document timeline to the corresponding point in the element's parent timeline.

endElement

Stops the element on the timeline.

endElementAt

Ends an element's timeline at the specified time.

item

Retrieves an object from the specified collection.

nextElement

Advances the timeline so that the next element in the sequence begins playing.

nextTrack

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

parentTimeToActiveTime

Converts a value in the parent timeline to the corresponding point in the element's active timeline.

parentTimeToDocumentTime

Converts a value in the element's parent timeline to the corresponding point in the document timeline.

pauseElement

Stops playing an element's timeline at the current point.

prevElement

Resets the timeline so that the previous element in the sequence begins playing.

prevTrack

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

resetElement

Removes any changes made to the element and returns the element to its original state.

resumeElement

Restarts the element's timeline from a paused state.

seekActiveTime

Locates a specified point on the element's active timeline and begins playing from that point.

seekTo

Locates a specified point on the element's segment timeline, including repetitions, and begins playing from that point.

seekToFrame

Locates a specified frame in the object.

segmentTimeToActiveTime

Converts a value in the element's segment timeline to the corresponding point in the element's active timeline.

segmentTimeToSimpleTime

Converts a value in the element's segment timeline to the corresponding point in the element's simple timeline.

setActive

Sets the playItem object as the active track in the playList collection, which causes the track to play.

simpleTimeToSegmentTime

Converts a value in the element's simple timeline to the corresponding point in the element's segment timeline.

Events

onbegin

Fires when the timeline starts on an element.

onend

Fires when the timeline stops on an element.

onmediacomplete

Fires when the element's associated media finish loading.

onmediaerror

Fires when an element's media file causes any error.

onoutofsync

Fires when the element loses synchronization with its associated timeline.

onpause

Fires when the timeline on an element pauses.

onrepeat

Fires when the timeline repeats on an element, beginning with the second iteration.

onreset

Fires when the timeline reaches the value of the BEGIN attribute or when the resetElement method is called on the element.

onresume

Fires when an element's timeline resumes from a paused state.

onreverse

Fires when the timeline on an element begins to play backward.

onseek

Fires whenever a seek operation is performed on the element.

onsyncrestored

Fires when synchronization is resumed between the element and its associated timeline.

ontimeerror

Fires whenever a time-specific error occurs, usually as a result of setting a property to an invalid value.

Collections

activeElements

Returns a reference to the collection of all top-level child elements of the object that are currently active on the timeline.

timeAll

Retrieves a reference to the collection of all timed elements.

timeChildren

Retrieves a reference to the collection of all timed, top-level children elements.