ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How To Use HTML5 | Include Files | Video Tags | HTML5 Video Tutorial

Updated on September 25, 2011

How does html5 video tag makes the difference?

The <video> tag is one of the most exciting and awaited feature of HTML5, there is no doubt that this video tag would make adding and viewing much easier. When we visit Youtube we can find that there are links by the side of a video clip to embed it to another web-page. Actually, there is no magic in this technology, it simply plays the video through Adobe’s Flash files. There are several other third-party players like realplayer, Quicktime etc. The plug-ings to support them are usually already installed separately in your browser. You mite notice that in some old computers Youtube cannot play the video because Adobe Flash plug in is not installed. The new html5 <video> tag eliminates all this complexity and enables you to play the video files in any browser without having an additional plugin installed.

Creating a supported Video File to embed using html5 video tag.

Before starting off to learn how to use the markups for embedding video in html5, you should keep in mind that all browsers don’t support every file formats. There are quite a lot of video file formats existing today and its quite difficult to create the <video> tag which can support all of them together ( may be now you got the real reason why you should be excited about the <video> tag in the first place). Today, the support for specific formats vary from browser to browser. So first we’ve to learn to create a the video files in the format which are supported by the specific browser. The table shows specific formats supported by each browsers. Naturally, you would by having this question in mind “So the video files embedded using <video> tag doesn’t play in all browsers?”. Yes, there are techniques for this, but for the time being lets learn the basics.

Video Formats Subpported by Browsers for HTML5

Source

How to use the html5 tag?

There are two ways to embed a file in html5 <video> tag. Single and Multiple. If you have only one video file you can simply link it to the src attribute. It is just as same as displaying the image <img src=”…”>.

To display One Video

<video src=”hello.webm”></video>

To adjust size :

<video src=”hello.webm” width=”320” height=”240”></video>

This <video> element doesn’t include any sort of player controls. You can include them your own in attractive ways by using CSS and Javascrip. The <video> element has methods like play() and pause(). If you want the browser to display a default control just ask it to display the built-in set of controls.

<video src=”hello.webm” width=”320” heigh=”240” controls></video>


Displaying Multiple Video Files In HTML5

<video width="320" height="240" controls>

  <source src="hello.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>

  <source src="hello.ogv"  type='video/ogg; codecs="theora, vorbis"'> 

  <source src="hello.webm" type='video/webm; codecs="vp8, vorbis"'> 

</video>

Be The First To Share HTML5!

You can be the first to one to let your peer computer enthusiasts know about html5 by sharing this on facebook and twitter at the top of this page. Do post your comments and doubts on the topic, i'll soon clear it off and help you out!If you found this article helpful, you can 'vote me up' in the green oval below.

The benefit of this trouble is that only the format supported by the browser is played, the rest is not even downloaded. This is also one way to make your video play in any format. These are technically all the things you need to implement <video> tags in html5. Hope you liked the tutorial.

Comments

    0 of 8192 characters used
    Post Comment

    • rasta1 profile image

      Marvin Parke 

      6 years ago from Jamaica

      I am looking into video publishing, It is so nice of you to do a third article.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://hubpages.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)