大网数据广告活动
Web 标准与前端开发

HTMLMediaElement: seeked event

· 52CE 我爱测

The `seeked` event is fired when a seek operation completed, the current playback position has changed, and the Boolean `seeking` attribute is changed to `false`.

HTMLMediaElement

The seeked event is fired when a seek operation completed, the current playback position has changed, and the Boolean seeking attribute is changed to false.

This event is not cancelable and does not bubble.

Syntax

Use the event name in EventTarget/addEventListener:

addEventListener("seeked", (event) => { })

Alternatively, assign to the event handler property of the interface:

onseeked = (event) => { }

Event type

A generic Event.

Examples

These examples add an event listener for the HTMLMediaElement's seeked event, then post a message when that event handler has reacted to the event firing.

Using addEventListener():

const video = document.querySelector("video");

video.addEventListener("seeked", (event) => {
  console.log("Video found the playback position it was looking for.");
});

Using the onseeked event handler property (but note that this replaces other event listeners added using onseeked, if any):

const video = document.querySelector("video");

video.onseeked = (event) => {
  console.log("Video found the playback position it was looking for.");
};

Specifications

Browser compatibility

Related Events

  • The HTMLMediaElement HTMLMediaElement.playing_event event
  • The HTMLMediaElement HTMLMediaElement.waiting_event event
  • The HTMLMediaElement HTMLMediaElement.seeking_event event
  • The HTMLMediaElement HTMLMediaElement.ended_event event
  • The HTMLMediaElement HTMLMediaElement.loadedmetadata_event event
  • The HTMLMediaElement HTMLMediaElement.loadeddata_event event
  • The HTMLMediaElement HTMLMediaElement.canplay_event event
  • The HTMLMediaElement HTMLMediaElement.canplaythrough_event event
  • The HTMLMediaElement HTMLMediaElement.durationchange_event event
  • The HTMLMediaElement HTMLMediaElement.timeupdate_event event
  • The HTMLMediaElement HTMLMediaElement.play_event event
  • The HTMLMediaElement HTMLMediaElement.pause_event event
  • The HTMLMediaElement HTMLMediaElement.ratechange_event event
  • The HTMLMediaElement HTMLMediaElement.volumechange_event event
  • The HTMLMediaElement HTMLMediaElement.suspend_event event
  • The HTMLMediaElement HTMLMediaElement.emptied_event event
  • The HTMLMediaElement HTMLMediaElement.stalled_event event

See also

  • HTMLAudioElement
  • HTMLVideoElement
  • audio
  • video

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。