New Post has been published on Better Hosting Review
New Post has been published on http://www.betterhostreview.com/add-html5-videos-websites.html
Add HTML5 Videos to Websites
With the lates HTML5 technology, embedding videos in websites has never been easier. You do not need advanced coding knowledge or any third party plug-ins in order to add or play web videos.
HTML5 video embedding makes use of the simplest code but achieve the maximum web browser compatibiity and hardware device compatibility. HTML5 videos can be played on browsers like IE, Firefox, Chrome, Safari and many more, and on various devices such as mobile phones, tablets, laptops, etc.
What are HTML5 videos and formats?
Unfortunately there are several video codec/formats are the actual HTML5 videos. Although we have made a great progress to have the HTML5 videos, it could be easier if we can have just one video codec/format in the future.
H.264(Baseline) in a .mp4 container.
VP8/WEBM in a .webm container.
Theroa/Vorbis in a .ogv container.
For maximum HTML5 video browser compatibility we need to make 3 different versions of the same video.
How to Embed HTML5 video into websites?
If you have single video source
<video src="demo.webm" width="640" height="480" autoplay></video>
If you have multiple video sources
<video width="640" height="480" controls>
<source src="http://www.yoursite.com/videos/demo.mp4" type="video/mp4" />
<source src="http://www.yoursite.com/videos/demo.webm" type="video/webm" />
<source src="http://www.yoursite.com/videos/demo.ogv" type="video/ogg" />
</video>
HTML5 video with poster image
The poster image will be displayed before playback. So make it relevant to the video content, your website visitors can decide whether to click and play your video or not from the poster image.
<video poster="http://www.yoursite.com/poster/demo.jpg" width="640" height="480" controls>
<source src="http://www.yoursite.com/videos/demo.mp4" type="video/mp4" />
<source src="http://www.yoursite.com/videos/demo.webm" type="video/webm" />
<source src="http://www.yoursite.com/videos/demo.ogv" type="video/ogg" />
</video>
If you do not like a poster image to let your website visitor to choose to play your video or not, you can set the HTML5 video to autoplay. Here is the sample code helps you with that.
<video poster="http://www.yoursite.com/poster/demo.jpg" width="640" height="480" autoplay controls>
<source src="http://www.yoursite.com/videos/demo.mp4" type="video/mp4" />
<source src="http://www.yoursite.com/videos/demo.webm" type="video/webm" />
<source src="http://www.yoursite.com/videos/demo.ogv" type="video/ogg" />
</video>