<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

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

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Join & Write a Comment

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month