国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

HTML 元素用于嵌入文檔中的聲音內(nèi)容。它可能包含一個或多個音頻源,用src<source>屬性或<audio>元素表示:瀏覽器將選擇最合適的一個。它也可以是流媒體的目的地,使用一個MediaStream。

內(nèi)容類別

流內(nèi)容,短語內(nèi)容,嵌入式內(nèi)容。如果它具有控件屬性:交互式內(nèi)容和可觸及的內(nèi)容。

允許的內(nèi)容

如果元素具有src屬性:零個或多個<track>元素,后跟不包含媒體元素的透明內(nèi)容,即不包含<audio>或<video>元素:零個或多個<source>元素,后跟零或更多<track>元素,后面是不包含媒體元素的透明內(nèi)容,即不包含<audio>或<video>。

標記遺漏

沒有,起始和結(jié)束標簽都是強制性的。

允許父母

任何接受嵌入內(nèi)容的元素。

允許ARIA角色

應(yīng)用

DOM界面

HTMLAudioElement

屬性

該元素包含 全局屬性。

autoplay布爾屬性;如果指定(默認值為"false"?。?;指定后,音頻會馬上自動開始播放,不會停下來等著數(shù)據(jù)載入結(jié)束。

自動播放音頻(或帶音軌的視頻)的站點對于用戶來說可能是一個不愉快的體驗,所以應(yīng)盡可能避免。如果您必須提供自動播放功能,您應(yīng)該選擇啟用(要求用戶專門啟用它)。但是,在用戶控制下創(chuàng)建媒體元素的源將在稍后設(shè)置時,這可能是有用的。

buffered你可以通過該屬性獲取已緩沖的資源的時間段信息。該屬性包含一個 TimeRanges對象。

controls如果設(shè)置了該屬性,瀏覽器將提供一個包含聲音,播放進度,播放暫停的控制面板,讓用戶可以控制音頻的播放。

loop布爾屬性;如果指定,將循環(huán)播放音頻。

mozCurrentSampleOffset在音頻播放時,表示相對于音頻開始處的偏移量的一個數(shù)值。

muted表示是否靜音的布爾值。默認值為false,表示有聲音。

played一個TimeRanges對象,表示所有已播放的音頻片段。

preload枚舉屬性,讓開發(fā)者自行思考來示意瀏覽器使用何種加載方式以達到最好的用戶體驗??梢允且韵聦傩灾唬?/p>

  • none: 示意用戶可能不會播放該音頻,或者服務(wù)器希望節(jié)省帶寬;換句話說,該音頻不會被緩存;

  • metadata: 示意即使用戶可能不會播放該音頻,但獲取元數(shù)據(jù) (例如音頻長度) 還是有必要的。

  • auto: 示意用戶可能會播放音頻;換句話說,如果有必要,整個音頻都將被加載,即使用戶不期望使用。

  • 空字符串 : 等效于auto屬性。

假如不設(shè)置,默認值就是瀏覽器定義的了(不同瀏覽器會選擇自己的默認值), 即使規(guī)范建議設(shè)置為 metadata.

使用備注:

  • autoplay 屬性優(yōu)先于 preload 假如用戶想自動播放視頻,那么很明顯瀏覽器需要下載視頻。同時設(shè)置autoplay 和 preload屬性在規(guī)范里是允許的。

  • 規(guī)范沒有強制瀏覽器去遵循該屬性的值;這僅僅只是個提示。

src嵌入的音頻的URL。 該URL應(yīng)遵從 HTTP access controls. 這是一個可選屬性;你可以在audio元素中使用 <source>元素來替代該屬性指定嵌入的音頻。

volume音頻播放的音量。值從0.0 (無聲) 到 1.0 (最大聲).

時間偏移量目前是指定為float類型的值,表示偏移的秒數(shù)。

備注: HTML 5 規(guī)范中,時間偏移量值的定義還沒有完成,有可能會變更。

事件

audio元素支持的事件

例子

基本用法

不支持<audio>元素的瀏覽器的其他內(nèi)容可以添加到開始和結(jié)束<audio></audio>標記中。

最基本的播放功能可以使用該controls屬性(見下面的示例); 對于更高級的用法,可以使用HTML Media API操作音頻播放和控件,更具體地說,可以使用HTMLAudioElement界面中定義的功能。

音頻流/網(wǎng)絡(luò)音頻API

您也可以使用Web Audio API來直接生成和處理來自JavaScript代碼的音頻流。

<audio>和字幕

雖然HTML5 <video>可以通過<track>添加字幕(請參閱將標題和字幕添加到HTML5視頻),但<audio>元素不能 : 忽略標簽<track>內(nèi)包含的任何<audio></audio>元素。請參閱Ian Devlin的WebVTT和Audio獲取更多有用的信息和解決方法。

示例

基本用法

<!-- Simple audio playback --><audio
  src="http://developer.mozilla.org/@api/deki/files/2926/=AudioTest_(1).ogg"
  autoplay>
  Your browser does not support the <code>audio</code> element.</audio>

使用source元素的audio元素

<audio controls="controls">
  Your browser does not support the <code>audio</code> element.  <source src="foo.wav" type="audio/wav"></audio>

規(guī)范

規(guī)范

狀態(tài)

評論

HTML Living Standard該規(guī)范中'<audio>'的定義。

生活水平


HTML5該規(guī)范中'<audio>'的定義。

建議


瀏覽器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

3.0

(Yes)

3.5 (1.9.1) 1

9.0

10.5

3.1

autoplay attribute

3.0

(Yes)

3.5 (1.9.1)

9.0

10.5

3.1

buffered attribute

?

(Yes)

4.0 (2.0)

?

?

?

controls attribute

3.0

(Yes)

3.5 (1.9.1)

9.0

10.5

3.1

loop attribute

3.0

(Yes)

11.0 (11.0)

9.0

10.5

3.1

muted attribute

?

(Yes)

11.0 (11.0)

?

?

?

played property

49

14

15.0 (15.0)

11

46

9.1

preload attribute

3.0

(Yes)

4.0 (2.0)

9.0

(Yes) 2

3.1

src attribute

3.0

(Yes)

3.5 (1.9.1)

9.0

10.5

3.1

volume attribute


(Yes)





Feature

Android

Edge

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

?

(Yes)

1.0 (1.0) 1

?

?

?

autoplay attribute

?

(Yes)

1.0 (1.0)

?

?

?

buffered attribute

?

(Yes)

4.0 (2.0)

?

?

?

controls attribute

?

(Yes)

1.0 (1.0)

?

?

?

loop attribute

?

(Yes)

11.0 (11.0)

?

?

?

muted attribute

?

(Yes)

11.0 (11.0)

?

?

?

played property

?

(Yes)

15.0 (15.0)

?

?

?

preload attribute

?

(Yes)

4.0 (2.0)

?

?

?

src attribute

?

(Yes)

1.0 (1.0)

?

?

?

volume attribute


(Yes)





Previous article: Next article: