Il tag HTML <track>



Descrizione

Il tag HTML <track> serve per impostare etichette, sottotitoli o altri contenuti per i tag <audio> e <video>

<!Doctype html>
<html>
<head>
<title>HTML source Tag</title>
</head>
<body>
<audio controls>
<source src = "yourfile.mp3">
<track src = "subtitles.vtt" kind="subtitles" srclang="en" label="English">
<p>:The browser doesnot support the file</p>
</audio>
</body>
</html>

Produrrà il seguente risultato:

Attributi Globali

Questo tag supporta tutti gli attributi globali descritti in - HTML - Referenze Attributi

Attributi Specifici

Il tag HTML <track> supporta anche i seguenti attributi aggiuntivi:

Attribute Value Descrizione
default HTML-5 default uses the default track
kind HTML-5

captions

chapters

descriptions

metadata

subtitles

tipo di elemento da utilizzare
label HTML-5 text mostra un titolo
src HTML-5 URL URL del file track
srclang class="inline" HTML-5 language_code indica la lingua del testo

Attributi Evento

Questo tag supporta tutti gli attributi evento descritti in - HTML - Referenze Eventi

Compatibilità Browser

ChromeFirefoxIEOperaSafariAndroid
SiSiSiSiSiSi
html_tags_reference.htm
Advertisements