audio – audio stream NEW # T
An
audio
element represents an audio stream.
Permitted contents #
Transparent,
with the following specific structure:
Permitted attributes #
-
global attributes
- Any attributes permitted globally.
-
autoplay =
"autoplay"
or "" (empty string) or empty
#
- Instructs the UA to automatically begin playback of
the audio stream as soon as it can do so without
stopping.
-
preload =
"none"
or "metadata"
or "auto"
or "" (empty string) or empty
#
- Represents a hint to the UA about whether optimistic
downloading of the audio stream itself or its
metadata is considered worthwhile.
- "none": Hints to the UA that the user
is not expected to need the audio stream, or that minimizing
unnecessary traffic is desirable.
- "metadata": Hints to the UA
that the user is not expected to need the audio stream,
but that fetching its metadata (duration and so on) is
desirable.
- "auto": Hints to the UA that
optimistically downloading the entire audio stream is
considered desirable.
Specifying the empty string is equivalent to specifying
the value "auto".
-
controls =
"controls"
or "" (empty string) or empty
#
- Instructs the UA to expose a user interface for
controlling playback of the audio stream.
-
loop =
"loop" or "" (empty string) or empty
#
- Instructs the UA to seek back to the start of the
audio stream upon reaching the end.
-
src =
Non-empty URL potentially surrounded by spaces
#
- The URL for the audio stream.
Additional constraints and admonitions #
-
The interactive element audio
with the attribute controls must not
appear as a descendant of the a element.
-
The interactive element audio
with the attribute controls must not
appear as a descendant of the button element.
Permitted parent elements #
any element that can contain
phrasing elements, any element that can contain
flow elements
DOM interface #
[NamedConstructor=Audio(),
NamedConstructor=Audio(in DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {};