What are some of the advantage (to the user) of using the track element for HTML5?
What advantages does the track ele开发者_如何学运维ment provide to the user?
The track element allows the separation of the media element (e.g., a video) from the text track. One advantage of this separation is the association of multiple tracks with a single video. Depending upon a user selection, the appropriate track could be displayed.
Here's an example of a video with 3 tracks:
<video src="starwars.mp4" type="video/mp4" controls autoplay width="800" height="600">
<track kind="captions" src="subs/english.srt" srclang="en" label="English Subtitles" default />
<track kind="captions" src="subs/german.srt" srclang="de" label="German Subtitles" />
<track kind="captions" src="subs/japanese.srt" srclang="ja" label="Japanese Subtitles" />
</video>
精彩评论