Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

TimeRanges

BaselineWidely available

When loading a media resource for use by an<audio> or<video> element, theTimeRanges interface is used for representing the time ranges of the media resource that have been buffered, the time ranges that have been played, and the time ranges that are seekable.

ATimeRanges object includes one or more ranges of time, each specified by a starting time offset and an ending time offset. You reference each time range by using thestart() andend() methods, passing the index number of the time range you want to retrieve.

Normalized TimeRanges objects

Several members ofHTMLMediaElement objects return anormalized TimeRanges object — whichthe spec describes as having the following characteristics:

The ranges in such an object are ordered, don't overlap, and don't touch (adjacent ranges are folded into one bigger range). A range can be empty (referencing just a single moment in time).

Instance properties

TimeRanges.lengthRead only

Returns anunsigned long representing the number of time ranges represented by the time range object.

Instance methods

TimeRanges.start()

Returns the time for the start of the range with the specified index.

TimeRanges.end()

Returns the time for the end of the specified range.

Specifications

Specification
HTML
# time-ranges

Browser compatibility

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp