<

Embedded Videos in HTML5

Posted on
6,083 Points
83 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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Join & Write a Comment

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month