![](../icon/headdata.png)
¡ÒÃá·Ã¡àÊÕ§ã¹àÇçºà¾¨
ËÒ¡ÇÕ´Õâͧ͢àÃÒ·ÕèàµÃÕÂÁäÇé ÁÕ¢¹Ò´·ÕèãËèà¡Ô¹ä» àÁ×èÍá·Ã¡Å§ä»ã¹àÇçºà¾¨´ÙäÁèàËÁÒÐÊÁ¡Ñºà¹×éÍËÒ àÃÒÊÒÁÒö¡Ó˹´¢¹Ò´¤ÇÒÁ¡ÇéÒ§áÅФÇÒÁÊÙ§¢Í§ÇÕ´ÕâÍä´é ¡ÒÃá·Ã¡ä¿ÅìàÊÕ§㹠HTML5 ÊÒÁÒö·ä´é§èÒÂ æ ´éÇ¡ÒÒáÓ˹´á·ç¡ <audio> â´Â¨Ðãªé src à¾×èÍàÅ×Í¡ä¿ÅìàÊÕ§ã´ÁÒáÊ´§º¹àÇçºà¾¨
Tag
ª×èÍá·ç¡ | audio |
µÓá˹è§á·ç¡ | ÍÂÙèÀÒÂã¹á·ç¡ <body>...</body> |
ÃٻẺ¡ÒÃãªéá·ç¡ | <audio scr="url" controls></audio> |
á͵·ÃÔºÔǵì | controls , src |
¤èÒ value | url µÓá˹觢ͧä¿ÅìàÊÕ§ - µÓá˹觷ÕèÍÂÙèÀÒÂã¹àÇçºä«µì (src="sound.mp3") - µÓá˹è§ÃÙ»ÀÒ¾·ÕèÍÂÙèàÇçºä«µìÍ×è¹ (src="http://www.example.com/sound.mp3") |
µÑÇÍÂèÒ§¡ÒÃãªé§Ò¹
<body>
<audio scr="sound.mp3" controls></audio>
</body>
<audio scr="sound.mp3" controls></audio>
¡ÒÃáÊ´§¼Å
¨Ò¡µÑÇÍÂèÒ§¨ÐàËç¹ä´éÇèÒ¨ÐÁÕ¡ÒáÓ˹´à¤Ã×èÍÁ×ͤǺ¤ØÁ ¾ÃéÍÁ¡Ñº¡ÒÃá·Ã¡ä¿ÅìàÊÕ§à¾×èÍãËéÊÒÁÒö¡Ó˹´¡ÒÃàÅè¹ä´é
¡ÒÃá·Ã¡ä¿ÅìàÊÕ§ãËéÃͧÃѺ·Ø¡àºÃÒÇìà«ÍÃì
à¹×èͧ¨Ò¡àºÃÒÇìà«ÍÃìáµèÅеÑÇÃͧÃѺä¿ÅìàÊÕ§·ÕèᵡµèÒ§¡Ñ¹ÍÍ¡ä» ´Ñ§¹Ñé¹àÃÒ¤ÇÃàµÃÕÂÁä¿ÅìàÊÕ§ãËé¤Ãº·Ø¡¿ÍÃìáÁµ à¾×èÍãËéÊÒÁÒöàÅ蹡ѺàºÃÒÇìà«ÍÃìä´é¤Ãº¶éǹ
Tag
ª×èÍá·ç¡ | source |
µÓá˹è§á·ç¡ | ÍÂÙèÀÒÂã¹á·ç¡ <audio>...</audio> |
ÃٻẺ¡ÒÃãªéá·ç¡ | <audio> <source src="url" type="value"> </audio> |
á͵·ÃÔºÔǵì | src |
¤èÒ value | url µÓá˹觢ͧä¿ÅìàÊÕ§ - µÓá˹觷ÕèÍÂÙèÀÒÂã¹àÇçºä«µì (src="sound.mp3") - µÓá˹è§ÃÙ»ÀÒ¾·ÕèÍÂÙèàÇçºä«µìÍ×è¹ (src="http://www.example.com/sound.mp3") type ª¹Ô´ÇÕ´ÕâÍ - audio/mp3 - audio/oga |
µÑÇÍÂèÒ§¡ÒÃãªé§Ò¹
<body>
<audio controls>
<source src="audio.mp3" type="audio/mp3">
<source src="audio.oga" type="audio/ogg">
</audio>
</body> <source src="audio.mp3" type="audio/mp3">
<source src="audio.oga" type="audio/ogg">
</audio>
¡ÒÃáÊ´§¼Å
¡ÒÃá·Ã¡àÊÕ§â´Â¡ÒÃãªéá·ç¡ <source> à¢éÒÁÒªèÇ¡ç¨Ð·ÓãËéÊÒÁÒöá·Ã¡ä¿ÅìàÊÕ§ä´éËÅÒÂÃٻẺ à¾×èÍÃͧÃѺ¡ÑºàºÃÒÇìà«ÍÃì·Ø¡µÑÇ