Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio seekable attribute

Audio seekable attribute

Audio Object Reference Audio object

Example

Get the first seekable range of the audio in seconds (part):

var x = document.getElementById("myAudio");

document.getElementById("demo").innerHTML = "Start: " + x.seekable.start(0)

xOutput value:

Start: 0 End: 12.612

Try it »


Definition and Usage

The seekable attribute returns a TimeRanges object.

The TimeRanges object represents the seekable ranges of the audio that the user can seek to.

A seekable range refers to the time range within the audio that the user can seek to (move the playback position).

For streaming audio, you can usually seek to any position in the audio, even if it has not finished buffering.

Note: This attribute is read-only.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the seekable attribute.

**Note:** Internet Explorer 8 or earlier browsers do not support this property.


Syntax

audioObject

.seekable

Return Value

Type Description
TimeRanges Object

Represents the seekable part of the audio.

TimeRanges object properties:

  • length - get the number of seekable ranges in the audio
  • start(index) - get the start position of a seekable range
  • end(index) - get the end position of a seekable range
  • Note:The index of the first seekable range, index, is 0.

    |

    Audio Object Reference Audio object