HTML | tipo atributo

El atributo de tipo HTML <fuente> se utiliza para especificar el tipo MIME del recurso multimedia.
Sintaxis: 
 

<source type="media_type">

Valores de atributo: contiene un valor único MIME_type que especifica el MIME_type del recurso multimedia. Pocos tipos MIME son video/ogg, videomp4, audio/ogg, etc.
Ejemplo 1: Este ejemplo ilustra el uso del atributo de tipo <source> con el archivo de audio. 
 

html

<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML source type Attribute
    </title>
</head>
 
<body style="text-align:center;">
     
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
     
    <h3>HTML Source type Attribute</h3>
     
    <audio controls>
        <source src=
"https://write.geeksforgeeks.org/wp-content/uploads/11.wav"
            type="audio/mpeg">
    </audio>
</body>
 
</html>                                           

Producción: 
 

Ejemplo 2: Este ejemplo ilustra el atributo de tipo <fuente> con el archivo de video. 
 

html

<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML source type Attribute
    </title>
</head>
 
<body style="text-align:center;">
     
    <h1 style="color:green;">
        GeeksforGeeks
    </h1> 
     
    <video width="420" height="240" controls>
        <source src=
"https://media.geeksforgeeks.org/wp-content/uploads/20190614120700/20190614_112020.mp4"
            type="video/mp4">
    </video>
</body>
 
</html>                                                          

Producción: 
 

Navegadores compatibles: 

  • Google Chrome 
  • Borde 12 y superior
  • Internet Explorer 9.0 y superior
  • Mozilla Firefox 3.5 y superior
  • Safari 
  • Ópera 

Publicación traducida automáticamente

Artículo escrito por ManasChhabra2 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *