Open In App

How to specify the URL of the media file in HTML5 ?

Last Updated : 26 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Here we will see how to set the URL of a media file using HTML. To set the URL of media file we use <source> tag. This tag is used to attach multimedia files like audio, video and pictures. The <audio>, <video> and <picture> elements contain the <source> element.

Syntax:

<source src="" type="">
   // Statements
</source>

Example:

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to specify the URL of
        the media file in HTML5?
    </title>
</head>
  
<body style="text-align: center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
  
    <h3>
        How to specify the URL of
        the media file in HTML5?
    </h3>
  
    <video width="400" height="350" controls>
        <source src=
            type="video/mp4">
    </video>
</body>
  
</html>


Output:

Supported Browsers:

  • Google Chrome 4.0
  • Internet Explorer 9.0
  • Firefox 3.5
  • Safari 4.0
  • Opera 10.5

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads