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

Last Updated : 23 Jul, 2025

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=
"https://media.geeksforgeeks.org/wp-content/uploads/output-1.mp4"
            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
Comment