type property

Gets or sets the MIME type of a media resource.

 

Syntax

object.put_type(
            
        string
           type);object.get_type(
            
        string
          * type);

Property values

Type: string

A valid MIME type that specifies the type of media resource that src points to.

Standards information

Remarks

You can use the codecs parameter to specify the exact encoding of the media resource. The following code example shows a source element that uses a type attribute and the codecs parameter to specify how a video was encoded.

    
<source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>