Coud anyone show me the real example, when used "chapter" value in "track" element. If you could, please help me.
I try in my server this example, but it doesn't show any result`
<body>
<video width= "500" height= "400" controls>
<source src= "html-lesson.mp4" type= "video/mp4">
<track src="html-lesson-hy.vtt" kind= "chapter" srclang= "hy" label= "Armenian">
<track src="html-lesson-en.vtt" kind= "chapter" srclang= "en" label= "English" default>
</video>
CodePudding user response:
Please use kind="chapters"
instead of chapter
. You can use this link to know more about it. https://www.w3schools.com/tags/tag_track.asp
CodePudding user response:
There are two really great resources for learning modern HTML:
- MDN, which has a page about the
track
element. - The "HTML Living Standard", which goes into a lot of detail, but can give insight into how certain features work. MDN links directly to the standard's description of the
track
element.
From this, we can learn two things:
- Firstly, the valid value for the "kind" attribute is "chapters", not "chapter".
- Secondly, the standard describes this track kind as "Chapters metadata", noting it is "Tracks intended for use from script. Not displayed by the user agent."
So, you need to correct your HTML, and then write some additional script to make use of the chapter data.