

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set the URL of the media file in HTML?
Use the src attribute to set the URL of the media file. You can try to run the following code to implement src attribute −
The src attribute works with the following elements: <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, and <video>.
Example
<!DOCTYPE HTML> <html> <body> <video width = "300" height = "200" controls autoplay> <source src = "/html5/foo.ogg" type = "video/ogg" /> <source src = "/html5/foo.mp4" type = "video/mp4" /> Your browser does not support the video element. </video> </body> </html>
- Related Questions & Answers
- How to specify the URL of the page the link goes to in HTML?
- How to specify the URL of the image to use in different situations in HTML?
- How to specify the target media types of a set of CSS rules
- How to specify the URL of the resource to be used by the object in HTML?
- How to set the name of the element in HTML?
- How do we set what media/device the linked document is optimized for in HTML?
- Execute a script when the length of the media changes in HTML?
- Execute a script when the media has reached the end of HTML?
- Set the shape of the area in HTML
- Set the width of the element in HTML
- Set the size of the icons in HTML
- How to set the audio output of the video to mute in HTML?
- Execute a script when the playback position of the media has changed in HTML?
- Set the name of the form the element belongs to in HTML?
- Set the language of the linked document in HTML
Advertisements