HTML - attributes - srclang

revision:


Content

"srclang" attribute: specifies the language of the track text syntax some examples


"srclang" attribute: specifies the language of the track text

top

The srclang attribute is used to specify the language of the track text. The srclang attribute can be applied on the <track>element

Note: srclang attribute is required with kind = “subtitles”.


syntax

top

<track src="subtitles_en.vtt" kind="subtitles" srclang="en">></track>

language_code specifies a two-letter language code that specifies the language of the track text data


some examples

top
codes
                    <video style=margin-left:3vw;" width="340" height="220" controls>
                        <source src="../pics/Wuzhen-20-10_02.mp4" type="video/mp4">
                        <track src="some_video_subtitles.srt" kind="subtitles" srclang="en" label="English_subs">
                    </video>
                

codes
                    <audio style="margin-left:3vw;" controls>
                        <source src = "../pics/horse.wav">
                        <track src = "subtitles.vtt" kind = "subtitles" srclang = "en" label =" English">                           
                        <p class="spec">:The browser doesnot support the file</p>
                    </audio>