Home  >  Article  >  Web Front-end  >  H5 sets or returns the currentTime property of the current position (in seconds) of audio/video playback

H5 sets or returns the currentTime property of the current position (in seconds) of audio/video playback

黄舟
黄舟Original
2017-11-08 11:02:303824browse

Example

Set the time position to 5 seconds:

myVid=document.getElementById("video1");
myVid.currentTime=5;

Definition and usage

currentTime property sets or returnsAudio/ The current position of video in seconds.

When this property is set, playback will jump to the specified position.

Browser support

All major browsers support the currentTime attribute.

Note: This attribute is not supported in Internet Explorer 8 or earlier browsers.

Syntax

Set currentTime attribute:

audio|video.currentTime="seconds"

Return currentTime attribute:

audio|video.currentTime

Attribute value

Value Description
seconds Indicates the current position of audio/video playback in seconds.

Technical details

Return value Numeric value, representing seconds

Example

Set the time position to 5 seconds:

 
 
 


The above is the detailed content of H5 sets or returns the currentTime property of the current position (in seconds) of audio/video playback. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn