From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/timeranges/index.html | 103 ++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 files/zh-cn/web/api/timeranges/index.html (limited to 'files/zh-cn/web/api/timeranges/index.html') diff --git a/files/zh-cn/web/api/timeranges/index.html b/files/zh-cn/web/api/timeranges/index.html new file mode 100644 index 0000000000..f6cf419d4b --- /dev/null +++ b/files/zh-cn/web/api/timeranges/index.html @@ -0,0 +1,103 @@ +--- +title: TimeRanges +slug: Web/API/TimeRanges +translation_of: Web/API/TimeRanges +--- +
{{APIRef("DOM")}}
+ +
 TimeRanges 接口用来表示一组时间范围,主要目的是跟踪供{{HTMLElement("audio")}} 和 
+ +
{{HTMLElement("video")}} 元素加载使用的媒体哪些部分已经被缓冲。  
+ +

一个 TimeRanges 对象包括一个或多个时间范围,其中每个都由一个开始偏移量和结束偏移量指定。你可以将你想要检索的时间范围的索引值传递给 start() 和 end() 方法来引用每个时间范围。

+ +

术语"normalized TimeRanges object"指出这种对象中的范围时有序的,不重叠的,不为空并且不接触的(相邻范围被折叠成更大的范围)。

+ +

属性

+ +
+
{{domxref("TimeRanges.length")}} {{ReadOnlyInline}}
+
返回一个 unsigned long 类型的数字。表示由time range对象表示的time ranges的数量。
+
+ +

方法

+ +
+
{{domxref("TimeRanges.start()")}}
+
返回具有指定索引的范围的开始时间。
+
{{domxref("TimeRanges.end()")}}
+
返回指定范围的结束时间。
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "embedded-content.html#time-ranges", "TimeRanges")}}{{Spec2("HTML WHATWG")}}Initial definition
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
-- cgit v1.2.3-54-g00ecf