<

Embedded Videos in HTML5

Posted on
6,071 Points
71 Views
Last Modified:
Experience Level: Beginner
4:11
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
Comment
0 Comments

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month