![](../icon/headdata.png)
¡ÒÃá·Ã¡ÇÕ´ÕâÍã¹àÇçºà¾¨
¡ÒÃàÅè¹ä¿ÅìÇÔ´Õâͺ¹àÇçºà¾¨ ÊÒÁÒö·Óä´é§èÒ æ´éÇ¡ÒÃÓ˹´á·ç¡ <video> â´ÂËÅÑ¡¡ÒÃÊӤѤ×Í µéͧÃкØÇèÒä¿Åì¶Ù¡à¡çºäÇé·Õèä˹à·èÒ¹Ñéé¹ «Öè§ÃٻẺ¡ÒÃãªéá·ç¡ <video> ã¹ HTML5 ÁÕÃٻẺ¾×é¹°Ò¹´Ñ§¹Õé
Tag
ª×èÍá·ç¡ | video |
µÓá˹è§á·ç¡ | ÍÂÙèÀÒÂã¹á·ç¡ <body>...</body> |
ÃٻẺ¡ÒÃãªéá·ç¡ | <video src="url"></video> |
á͵·ÃÔºÔǵì | src |
¤èÒ value | url µÓá˹觢ͧÃÙ»ÀÒ¾ - µÓá˹觷ÕèÍÂÙèÀÒÂã¹àÇçºä«µì (src="vido.mp4") - µÓá˹è§ÃÙ»ÀÒ¾·ÕèÍÂÙèàÇçºä«µìÍ×è¹ (src="http://www.example.com/video.mp4") |
µÑÇÍÂèÒ§¡ÒÃãªé§Ò¹
<body>
<video src="video.mp4"></video>
</body>
¡ÒÃáÊ´§¼Å
¨Ò¡¡ÒÃá·Ã¡ÇÕ´ÕâÍŧã¹àÇçºà¾¨¨ÐàËç¹ÀÒ¾µÑÇÍÂèÒ§ áµèÇÕ´ÕâÍäÁèÊÒÁöàÅè¹ä´é ¨Ðµéͧ¡Ó˹´ÃٻẺ¡ÒäÇÒÁ¤ØÁ¢Í§ÇÕ´ÕâÍ¡è͹¶Ö§¨ÐÊÒÁÒö·ÓãËéÇÕ´ÕâÍàÅè¹ä´é
¡ÒÃá·Ã¡ÇÕ´ÕâÍãËéÃͧÃѺ·Ø¡àºÃÒÇìà«ÍÃì
ÊÔè§ÊӤѷÕèàÃÒµéͧ¤Ó¹Ö§¶Ö§ àºÃÒÇìà«ÍÃìáµèÅеÑÇÃͧÃѺä¿ÅìÇÕ´ÕâÍ·ÕèᵡµèÒ§¡Ñ¹ÍÍ¡ä»àÃÒ¤ÇàµÃÕÂÁä¿ÅìÇÕ´ÕâÍãËé¤Ãº·Ø¡¿ÍÃìáÁµ à¾×èÍãËéÊÒÁÒöàÅ蹡ѺàºÃÒÇìà«ÍÃìä´é·Ø¡µÑÇ
Tag
ª×èÍá·ç¡ | source |
µÓá˹è§á·ç¡ | ÍÂÙèÀÒÂã¹á·ç¡ <video>...</video> |
ÃٻẺ¡ÒÃãªéá·ç¡ | <video > <source src="url" type="video/mp4"> </video> |
á͵·ÃÔºÔǵì | src |
¤èÒ value | url µÓá˹觢ͧÇÕ´ÕâÍ - µÓá˹觷ÕèÍÂÙèÀÒÂã¹àÇçºä«µì (src="vido.mp4") - µÓá˹è§ÃÙ»ÀÒ¾·ÕèÍÂÙèàÇçºä«µìÍ×è¹ (src="http://www.example.com/video.mp4") type ª¹Ô´ÇÕ´ÕâÍ - video/mp4 - video/webm - video/ogg |
µÑÇÍÂèÒ§¡ÒÃãªé§Ò¹
<body>
<video >
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
<source src="video.ogv" type="video/ogg">
</video>
</body> <source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
<source src="video.ogv" type="video/ogg">
</video>
¡ÒÃáÊ´§¼Å
¨ÐàËç¹ä´éÇèÒàÃÒÊÒÁÒöá·Ã¡ÇÕ´Õâ;ÃéÍÁ¡Ñ¹ä´éËÅÒÂÃٻẺ¾ÃéÍÁ¡Ñ¹ «Öè§àÇÅÒàºÃÒÇìà«ÍÃìµÃǨÊͺà¾×èÍàÅè¹ÇÕ´ÕâÍ ¨ÐµÃǨÊͺàÃÔèÁ¨Ò¡ºÃ÷ѴááËÃ×Í <source> µÑÇáá ¶éÒËÒ¡äÁèÃͧÃѺ¡ÑºàºÃÒÇìà«ÍÃì ¡ç¨ÐµÃǨºÃ÷ѴµèÍä»