HTML <track> ป้ายกำกับแอตทริบิวต์
ตัวอย่าง
วิดีโอที่มีแทร็กคำบรรยายสองแทร็ก ทั้งคู่มีป้ายกำกับที่กำหนดไว้:
<video width="320" height="240" controls>
<source src="forrest_gump.mp4" type="video/mp4">
<source src="forrest_gump.ogg" type="video/ogg">
<track src="fgsubtitles_en.vtt" kind="subtitles" srclang="en" label="English">
<track src="fgsubtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian">
</video>
ความหมายและการใช้งาน
แอตทริบิวต์label
ระบุชื่อแทร็กข้อความ และเบราว์เซอร์จะใช้เมื่อแสดงรายการแทร็กข้อความที่มีอยู่
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
label | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
ไวยากรณ์
<track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
ค่าแอตทริบิวต์
Value | Description |
---|---|
label | Specifies the title of the text track |
❮ แท็ก HTML <track>