It's free and you have access to premium codes!
Welcome back! Please login to your account.
Don't worry, we'll send you a message to help you to recover your acount.
Please check your email for instructions to activate your account.
Written by 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.
<!-- this script is provided by https://www.html5freecode.com coded by: Kerixa Inc. -->
<!-- This Script is from www.html5freecode.com, Coded by: Kerixa Inc-->
<video width="320" height="220" controls onloadeddata="ply()" id="vid">
<source src="http://www.html5freecode.com/files/html5-video-element-sample.mp4" type="video/mp4">
</video>
<div style="text-align: left"><br><font face="Tahoma"><br><a target="_blank" href="https://html5freecode.com"><span style="font-size: 8pt; text-decoration: none">HTML5 Free Code</span></a></font></div>
<script>
function ply(){
var vid= document.getElementById('vid')
vid.play()
}
</script><a target='_blank' href='https://www.html5freecode.com' style='font-size: 8pt; text-decoration: none'>Html5 Free Codes</a>
Comments
Here you can leave us commments. Let us know what you think about this code tutorial!