HTML <audio>プリロード属性

❮HTML<audio>タグ

作成者は、ページの読み込み時にサウンドを読み込まないようにする必要があると考えています。

<audio controls preload="none">
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

定義と使用法

このpreload属性は、ページの読み込み時にオーディオファイルを読み込む必要があると作成者が考えるかどうかとその方法を指定します。

このpreload属性を使用すると、作成者は、最高のユーザーエクスペリエンスにつながると考えていることについて、ブラウザーにヒントを提供できます。この属性は、場合によっては無視されることがあります。

注:が存在する場合、preload属性は無視されますautoplay


ブラウザのサポート

表の数字は、属性を完全にサポートする最初のブラウザーバージョンを示しています。

Attribute
preload 4.0 9.0 4.0 4.0 11.5

構文

<audio preload="auto|metadata|none">

属性値

Value Description
auto The author thinks that the browser should load the entire audio file when the page loads
metadata The author thinks that the browser should load only metadata when the page loads
none The author thinks that the browser should NOT load the audio file when the page loads

❮HTML<audio>タグ