blob: cd23bfc3e9fbde0bd53252af95ffac0cbcfec441 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
---
title: HTMLMediaElement.seekable
slug: Web/API/HTMLMediaElement/seekable
translation_of: Web/API/HTMLMediaElement/seekable
---
<div>{{APIRef("HTML DOM")}}</div>
<p>{{domxref("HTMLMediaElement")}}的只读属性<strong><code>seekable</code></strong>返回一个包含了用户可以跳转到的时刻的区域(如果有)的{{domxref('TimeRanges')}}对象。</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">var seekable = audioOrVideo.seekable;</pre>
<h3 id="值">值</h3>
<p>一个{{domxref('TimeRanges')}}对象。</p>
<h2 id="示例">示例</h2>
<pre class="brush: html">var video = document.querySelector("video");
var timeRangesObject = video.seekable;
var timeRanges = [];
//遍历所有时间区域并输出数组
for (let count = 0; count < timeRangesObject.length; count ++) {
timeRanges.push([timeRangesObject.start(count), timeRangesObject.end(count)]);
}
</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', "the-video-element.html#dom-media-seekable", "HTMLMediaElement")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>No change from {{SpecName('HTML5 W3C')}}</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', "embedded-content-0.html#dom-media-seekable", "HTMLMediaElement")}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>Initial definition.</td>
</tr>
<tr>
<td>{{SpecName('Media Source Extensions','#htmlmediaelement-extensions','HTMLMediaElement extensions, like for seekable')}}</td>
<td>{{Spec2('Media Source Extensions')}}</td>
<td>Specifies a new algorithm for returning the seekable time range of a media element whose source is a {{domxref("MediaSource")}} object.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
<p>{{Compat("api.HTMLMediaElement.seekable")}}</p>
</div>
<h2 id="See_Also" name="See_Also">See also</h2>
<ul>
<li>The interface defining it, {{domxref("HTMLMediaElement")}}.</li>
<li><a href="/en-US/docs/Web/API/Media_Source_Extensions_API">Media Source Extensions API</a></li>
</ul>
|