<

Embedded Videos in HTML5

Posted on
6,084 Points
84 Views
Last Modified:
Published
Experience Level: Beginner
4:10
In this tutorial viewers will learn how to embed videos in a webpage using HTML5.

Video Steps

1. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>"

2. Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to the src in the <img> tag.

3. Close the tag by typing </video>

4. You can define the height and width of the displayed video by typing "height=" and "width="

5. To display an image while the video is loading, use the poster property by typing poster="" with the URL of your image within the quotations

6. To loop the video on the page, type "loop" after the source and before closing the tag

7. To add controls so visitors can pause and adjust volume, type "controls" after the source and before closing the tag

8. To have the video's sound automatically set to mute, type "muted" after the source and before closing the tag

9. To have the video autoplay as soon as the page loads, type "autoplay" after the source and before closing the tag. If you choose to autoplay your video, it's helpful to also include controls so the visitor can choose to end the video and to set it as muted

10. To display a backup image in case a visitor's browser doesn't support HTML5, insert an <img> tag with your image between the <video> tag and the </video> tag

0
0 Comments

Suggested Videos

Title Views Activity
Navigation Hover Effects with CSS Sprites 316
Introduction to CSS (Part 2) 115
Introduction to HTML (Part 1) 115
Lists and Links 106
Join us in celebrating longtime user Rowby Goren for his great contributions of engaging with other users on site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a H…
This article covers 3 key tips for entering the IT field and resources to leverage in order to pursue the path you wish to run towards. These tips apply to those especially without a background in IT at any age. On your mark, get set....go!

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month