HTML - attributes - default

revision:


Content

"default" attribute : boolean attribute that enables a track syntax some examples


"default" attribute : boolean attribute that enables a track

top

When present, it specifies that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate. There must only be one <track> element with a default attribute per <media> element.


syntax

top

<track src=" . . . " default>

The <track> tag specifies text tracks for <audio> or <video> elements. This element is used to specify subtitles, caption files or other files containing text, that should be visible when the media is playing.

default specifies that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.


some examples

top
codes:
                    <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" default>
                        <track src="fgsubtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian">
                    </video>
                

codes:

                    <video width="100" height="100" controls>
                        <track src=" " kind="subtitles" srclang="en" label="English" default>
                        <source id="myTrack" src=" "  type="video/mp4">
                    </video>