Latest web development tutorials

ontimeupdate event

Event Object Reference Event objects

Examples

JavaScript is executed during playback to change the current position:

<Video ontimeupdate = "myFunction ()">

try it"

Bottom of this article contains more examples.


Definition and Usage

ontimeupdate event triggers changes in the transmission of video / audio (audio / video) the current playback position.

The event by calling the following ways:

  • Playing a video / audio (audio / video)
  • Reposition the video / audio (audio / video) playback position.

Note: This event is usually the Video object currentTime use with property, which returns the video / audio (audio / video) of the current playback position.


Browser Support

Figures in the table represent the first browser to support this version of events.

Event
ontimeupdate Yes 9.0 Yes Yes Yes


grammar

In HTML:

<Elementontimeupdate = "myScript"> try

In JavaScript:

object .ontimeupdate = function () {myScript }; try

JavaScript, use the addEventListener () method:

object .addEventListener ( "seeking", myScript ); try

Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.


technical details
Whether to support the bubble: No
It can be canceled: No
Event Type: Event
Supported HTML tags: <Audio>, <video>


Examples

More examples

Examples

JavaScript is executed when the user starts playing audio or reposition the audio playback position:

<Audio ontimeupdate = "myFunction ()">

try it"

Examples

Use currentTime property of the current playback position is 5 seconds:

document.getElementById ( "myVideo") currentTime = 5.;

try it"


Event Object Reference Event objects