Introducing the HTML5 Video Element
Join the DZone community and get the full member experience.
Join For Free
Forget using the <iframe> element for sharing
videos to your friends. There is an easier way to do this. Now, with HTML5 you
can use the <video> element:
<!DOCTYPE html> <html> <body> <video width="448" height="336" controls="controls" poster="poster.jpg"> <source src="Nole vs. Rafa.mp4" type="video/mp4" /> <source src="Nole vs. Rafa.ogg" type="video/ogg" /> Your browser does not support the video tag. </video> </body> </html>
And the output will be:
The <video>
tag is supported in Internet Explorer 9 (earlier versions does not
support the <video> element), Firefox, Opera, Chrome and
Safari.
poster="poster.jpg" – specifies an image to be shown while the video is
downloading, or until the user hits the play button
HTML
Element
Published at DZone with permission of A. Programmer. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments