Video- Easily Play a Video in Your Web Page

Written by @m_k_amin 7 June 2013

Video is a great feature for websites and make more robust connection with users. HTML5 prepared a tool for playing different video formats. You may be annoyed from playing video before, because of finding a suitable player, but now it is easy, reliable and fast by HTML5 video element. In the following code you can see how we can play a video just by few lines of code. The HTML5 video element supports many events and attributes but they were not included in this example because of simplicity. Although some browsers may not support specific video types, by defining multiple sources, if one fails, it goes automatically to the next format; so the video element becomes browser friendly.

Code Snippet:

                                                <!-- this script is provided by coded by: Kerixa Inc. -->
<!-- This Script is from, Coded by: Kerixa Inc-->
<video width="320" height="220" controls autoplay onloadeddata="ply()" id="vid">
	<source src="" type="video/ogg">
	<source src="" type="video/mp4">
<div style="text-align: left"><br><font face="Tahoma"><br><a target="_blank" href=""><span style="font-size: 8pt; text-decoration: none">HTML5 Free Code</span></a></font></div>
function ply(){
	var vid= document.getElementById('vid')	
</script><a target='_blank' href='' style='font-size: 8pt; text-decoration: none'>Html5 Free Codes</a>                                                


About @m_k_amin

This user is pending a biography.



Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

Online Users: 12
Recent Members: FOTPU
advertisement 2