HTML5: How to specify the URL of the video file?
Solution:
HTML Code:
<!DOCTYPE html><!-- Define document type as HTML -->
<html><!-- Begin HTML document -->
<head><!-- Start of document header -->
<meta charset="utf-8"><!-- Define character encoding -->
<title>How to specify the URL of the video file</title><!-- Title of the HTML page -->
</head><!-- End of document header -->
<body><!-- Start of document body -->
<video width="300" hight="250" controls <!-- Video element with specified width, height, and controls attributes -->
src="https://www.w3resource.com/html-css-exercise/basic/solution/php-demo1.ogg"><!-- Specify the source URL of the video file -->
</video><!-- End of video element -->
</body><!-- End of document body -->
</html><!-- End of HTML document -->
Explanation:
- The HTML code defines a video element using the <video> tag.
- The width attribute is set to 300 pixels and the height attribute is incorrectly set to "hight" instead of "height", specifying the dimensions of the video player. This is a typo in the code.
- The controls attribute is included to display video controls, allowing users to interact with the video playback.
- The src attribute specifies the URL of the video file ("https://www.w3resource.com/html-css-exercise/basic/solution/php-demo1.ogg").
- This code creates a video player with the specified source URL, allowing users to view and control the video playback within the web page.
Live Demo:
See the Pen video-src-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/html-css-exercise/basic/video-src-answer.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics