English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

HTML Tag大全

HTML Audio/Video DOM seekable Eigenschaft

Die schreibgeschützte Eigenschaft seekable von HTMLMediaElement gibt ein TimeRanges-Objekt zurück, das die Bereiche enthält, zu denen der Benutzer springen kann (wenn vorhanden).

 HTML Audio/Video DOM Reference Manual

Online-Beispiel

Erhalten Sie den ersten Suchbereich des Videos in Sekunden (Teil):

!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Audio/Video seekable Eigenschaft verwenden-Grund教程(oldtoolbag.com)</title>
</head>
<body>
<button onclick="getFirstSeekableRange()" type="button">Erhalten Sie den ersten Sekunden-basierten Videosuchbereich</button>
<br> 
<video id="video1" controls="controls">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Ihr Browser unterstützt HTML5 video  Tag.
</video>
<script>
myVid=document.getElementById("video1");
function getFirstSeekableRange()
{ 
  alert("Start: " + myVid.seekable.start(0) + " Ende: "  + myVid.seekable.end(0));
} 
</script> 
</body>
</html>
Testen Sie es heraus ‹/›

Definition und Verwendung

Die Eigenschaft seekable gibt ein TimeRanges-Objekt zurück.
The TimeRanges object represents the audio that can be searched for by the user/Video range.
Searchable range is the audio that the user can search (move the playback position)/Video time range.
For non-streaming videos, it is usually even possible to search any position in the video before the video is buffered.
Note: This property is read-only.

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the seekable property.

Note:Internet Explorer 8 And earlier versions do not support this property.

Syntax

audio|video.seekable

Return value

TypeDescription
TimeRanges ObjectRepresents audio/Addressable parts in the video.

Properties of TimeRanges Object:

  • length - Get audio/The number of addressable ranges in the video

  • start(index) - Get the start position of the addressable range

  • end(index) - Get the end position of the addressable range

Note:The first index of the addressable range index Is 0.

 HTML Audio/Video DOM Reference Manual