HTML5 Video

Everything you need to know about HTML5
Site Admin
Posts: 159
Joined: Sun Jun 26, 2022 10:46 pm

HTML5 Video

Post by C0D3D »

Embedding video in HTML documents

Example 1

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Embedding Video into an HTML Page</title>
</head>
<body>
	<video controls="controls" src="/videos/sample.mp4">
        Your browser does not support the HTML5 Video element.
    </video>
</body>
</html>
Defining alternative sources for video element

Example 2

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Specify Alternate Sources for video Element in HTML</title>
</head>
<body>
	<video controls="controls">
        <source src="/videos/sample.mp4" type="video/mp4">
        <source src="/videos/sample.ogv" type="video/ogg">
        Your browser does not support the HTML5 Video element.
    </video>
</body>
</html>
Inserting video in HTML documents using the object element

Example 3

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Inserting Video Using object Element</title>
</head>
<body>
	<object data="/videos/sample.mp4" width="400px" height="200px"></object>
</body>
</html>
Inserting video in HTML documents using the embed element

Example 4

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Inserting Video Using embed Element</title>
</head>
<body>
	<embed src="/videos/sample.mp4" width="400px" height="200px">
</body>
</html>
Embedding the YouTube video in HTML documents

Example 5

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Embedding a YouTube Video in an HTML Page</title>
</head>
<body>
	<iframe width="560" height="315" src="//www.youtube.com/embed/YE7VzlLtp-4" frameborder="0" allowfullscreen></iframe>
    <p>Source: <a href="https://www.youtube.com/watch?v=YE7VzlLtp-4" target="_blank" rel="nofollow">https://www.youtube.com/watch?v=YE7VzlLtp-4</a></p>
</body>
</html> 
----------------------------------------------------------------------
Together we are one! One we are many... Much Love from one brother to another...
Working together to achieve amazing things!
Teamwork is key.
Knowledge is Power!

4 Basic datatypes.
Strings: Which store a series of characters.
Int: Which store a full integer or number.
Float: A numeric value with a decimal.
Boolean: Only stores True or False and are very useful with if statements

----------------------------------------------------------------------
ImgBB Image upload

Who is online

Users browsing this forum: No registered users and 0 guests