HTMLMediaElement: preload プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
preload
は HTMLMediaElement
インターフェイスのプロパティで、製作者がどうすればもっとも使い勝手が良くなると考えているかについて、ブラウザーに与えるヒントを示す文字列です。
値
例
html
<video
id="el"
controls
src="https://example.com/media.mp4"
poster="https://example.com/media.jpg"
width="800"
height="600"
preload="metadata">
申し訳ありませんが、お使いのブラウザーは埋め込み動画に対応していません。<a href="https://example.com/media.mp4" download="media.mp4">ダウンロードする</a>ことで、お好きな動画プレイヤーでご覧いただけますのでご安心ください!
</video>
js
const el = document.getElementById("el");
console.log(el.preload); // 出力: "metadata"
仕様書
Specification |
---|
HTML # dom-media-preload |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
preload |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.