एचटीएमएल <ट्रैक> टैग
उदाहरण
उपशीर्षक वाला एक वीडियो दो भाषाओं के लिए ट्रैक करता है:
<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>
परिभाषा और उपयोग
टैग <ऑडियो> या <वीडियो>
तत्वों के <track>
लिए टेक्स्ट ट्रैक निर्दिष्ट करता
है।
इस तत्व का उपयोग उपशीर्षक, कैप्शन फाइल या टेक्स्ट वाली अन्य फाइलों को निर्दिष्ट करने के लिए किया जाता है, जो मीडिया के चलने पर दिखाई देनी चाहिए।
ट्रैक को WebVTT प्रारूप (.vtt फ़ाइलें) में स्वरूपित किया जाता है।
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से तत्व का समर्थन करता है।
Element | |||||
---|---|---|---|---|---|
<track> | 23.0 | 10.0 | 31.0 | 6.0 | 12.1 |
वैकल्पिक गुण
Attribute | Value | Description |
---|---|---|
default | default | Specifies that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate |
kind | captions chapters descriptions metadata subtitles |
Specifies the kind of text track |
label | text | Specifies the title of the text track |
src | URL | Required. Specifies the URL of the track file |
srclang | language_code | Specifies the language of the track text data (required if kind="subtitles") |
वैश्विक गुण
<track>
टैग HTML में वैश्विक विशेषताओं का भी समर्थन करता है ।
घटना गुण
<track>
टैग HTML में ईवेंट विशेषताओं का भी समर्थन करता है ।
संबंधित पृष्ठ
एचटीएमएल ट्यूटोरियल: एचटीएमएल वीडियो
एचटीएमएल ट्यूटोरियल: एचटीएमएल ऑडियो
HTML DOM संदर्भ: ट्रैक ऑब्जेक्ट
डिफ़ॉल्ट सीएसएस सेटिंग्स
कोई नहीं।