You use the video element to embed video content into a web page.
The following table describes the video element.
Element: | video |
---|---|
Element Type: | Flow/Phrasing |
Permitted Parents: | Any element that can contain flow or phrasing elements |
Local Attributes: | autoplay, preload, controls, loop, poster, height, width, muted, src |
Contents: | source and track elements, plus phrasing and flow content |
Tag Style: | Start and end tags |
Style Convention | None |
The following code shows the basic use of this element.
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <video width="360" height="240" src="http://java2s.com/style/demo/your.webm" autoplay controls preload="none" muted> Video cannot be displayed /*from w w w .java 2 s. co m*/ </video> </body> </html>
If the browser doesn't support the video element or cannot play the video, the content between the start and end tags (the fallback content) will be displayed.