A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLMediaElement/load below:

HTMLMediaElement.load() - Web API | MDN

HTMLMediaElement.load()

Baseline Widely available

load() 方法重置媒体成初始化状态,选择一个播放源,为载入媒体重新播放做准备。媒体预播放的信息是由 preload 这个参数决定的。

此方法只在对媒体做动态更改时管用,要么更改src属性,要么添加或删除source 。 load() 将会重置元素重新扫描可用的源,从而让改动生效。

语法 参数

None.

返回值

undefined.

使用说明

调用 load() 会使媒体上所有正在进行的操作中止,然后根据 audio 或者 video 元素的 src 或者 source 属性里寻找合适的播放源并重新加载媒体内容。更多查看 Supporting multiple formats 和 Video and audio content 。

The process of aborting any ongoing activities will cause any outstanding Promises returned by play() being resolved or rejected as appropriate based on their status before the loading of new media can begin. Pending play promises are aborted with an "AbortError" DOMException.

在 load 过程中 合适的事件会发生并通知给媒体本身,包括:

例子

例子中有一个 <video> 元素然后重置它 load().

var mediaElem = document.querySelector("video");
mediaElem.load();
规范 浏览器兼容性

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4