ontimeupdateEvent
Example
Execute JavaScript when the current playback position changes:
Try it yourself »
More examples are included at the bottom of this article.
Definition and Usage
The ontimeupdate event is triggered when the current playback position of the video/audio changes.
This event is invoked through the following ways:
- Playing the video/audio
- Repositioning the playback position of the video/audio.
Tip:This event is usually used with the Video object's currentTimeproperty, which returns the current playback position of the audio/video.
Browser Support
The numbers in the table specify the first browser version that fully supports the event.
| Event | |||||
|---|---|---|---|---|---|
| ontimeupdate | Yes | 9.0 | Yes | Yes | Yes |
Syntax
In HTML:
In JavaScript:
In JavaScript, using the addEventListener() method:
Note:Internet Explorer 8 and earlier IE versions do not supportaddEventListener()the method.
Technical Details
| Bubbles: | No |
|---|---|
| Cancelable: | No |
| Event type: | Event |
| Supported HTML tags: | <audio>, <video> |

More Examples
Example
Execute JavaScript when the user starts playing audio or repositions the audio playback position:
Try it yourself »
Example
Use the currentTime property to set the current playback position to 5 seconds:
Try it yourself »
Event Object Other Extensions