seeking event is fired when a seek operation starts, meaning the Boolean seeking attribute has changed to true and the media is seeking a new position.

冒泡 No
可取消 No
接口 事件
目标 元素
默认动作 None
事件处理程序特性 GlobalEventHandlers.onseeking
规范 HTML5 媒体

范例

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

使用 addEventListener() :

const video = document.querySelector('video');
video.addEventListener('seeking', (event) => {
  console.log('Video is seeking a new position.');
});
					

使用 onseeking 事件处理程序特性:

const video = document.querySelector('video');
video.onseeking = (event) => {
  console.log('Video is seeking a new position.');
};
					

规范

规范 状态
HTML 实时标准
The definition of 'seeking media event' in that specification.
实时标准
HTML5
The definition of 'seeking media event' in that specification.
推荐

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
seeking event Chrome 3 Edge 12 Firefox 3.5 IE 9 Opera 10.5 Safari 3.1 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0

图例

完整支持

完整支持

另请参阅

元数据

  • 最后修改: