Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Understanding HTML5 video and audio

From: HTML5: Video and Audio in Depth

Video: Understanding HTML5 video and audio

At this point with all the discussion around it, it would be hard to believe that you've never heard of HTML5 video. Still I think to dive into what HTML5 video is exactly would be useful. HTML5 video is the future of video playback on the web. You can see in this chart that I believe somewhere around 2015 HTML5 video will be the primary method for video playback on the web. Looking back, when video started with plug-ins like Real Player, QuickTime and Windows Media Player, there wasn't a clearly dominant plug-in at the time so what developers would often try to support all three, to make sure video could reach as much of their audience as possible.

Understanding HTML5 video and audio

At this point with all the discussion around it, it would be hard to believe that you've never heard of HTML5 video. Still I think to dive into what HTML5 video is exactly would be useful. HTML5 video is the future of video playback on the web. You can see in this chart that I believe somewhere around 2015 HTML5 video will be the primary method for video playback on the web. Looking back, when video started with plug-ins like Real Player, QuickTime and Windows Media Player, there wasn't a clearly dominant plug-in at the time so what developers would often try to support all three, to make sure video could reach as much of their audience as possible.

Then Flash came on the scene and was able to gain a high enough level of user adoption that Web developers could support almost all their audience just through Flash. To this day Flash has a solid lead over other plug-ins in both user support and web developers using it for video playback. Now very much thanks to Flash video has become an integral part of the web. According to comScore, 83.5% of Internet users viewed online video in March 2011. During the rise of Flash and video on the web, browser developers recognized the importance of video and started tossing around the idea of making video a native part of HTML and the browser experience just like text and images.

In 2007, the developers of the Opera web browser released a version of Opera that included support for a video tag that mimicked the image tag and would play back video in the browser using a built-in video player as opposed to a plug-in. From this the specification for an HTML video tag was born. In the following years rather developers and other interested parties continue to refine the specification and other browsers besides Opera began building in their own video players and support for the video tag. Now a very important distinction should be pulled from this.

With HTML5 video each web browser is building their own video player, which means one browser's video player could be very different from the next. One of the benefits of Flash is that since it's a plug-in, it's basically the same code running in each browser and from the most part you can expect Flash video in Internet Explorer to work the same as it does in Firefox. With HTML5 video, video could work differently in each browser because each browser vendor is building their own player. Different styles of controls in each browser illustrate this point.

You can see they look very different. But despite the fact that they look different, they all have the same basic controls and work as expected. This is where the importance of standards comes in. That specification for the HTML video tag that I mentioned is instructions for browser developers on how the video tag should work. And for the most part, they've all done a great job of following these instructions, aside from certain browsers not supporting specific features quite yet. When they do support a feature, they all support it in basically same way. So we can expect the video tag to work the same in all browsers.

This is great because we all know what it's like when browsers don't work the same way. If you're interested you can read the video tag specifications on either the W3C site or the WHATWG site. Both are basically the same and they are actually maintained by the same person. WHATWG site I believe tends to have the most recent information, but is also more likely to change, whereas the W3C version is more locked down. But remember these are instructions for the browser developers and not necessarily for us as web developers, though it's a great resource for us to see how the video tag should work.

So I have talked a lot about HTML5 video specifically but what about HTML5 audio? So it's called HTML5: Video and Audio in Depth, right? Well, HTML5 audio is basically the little brother of HTML5 video. They are both built on top of the same parent element, the media element, which means they share the same DNA. In fact I don't believe there's any attribute of the audio element that can't be found in the video element as well, except for these specific file types that the audio element supports. Which makes sense because videos also have audio in them, but there are a number of attributes that the video element has and audio doesn't. And they all center around the fact that you're also viewing something at the same time.

It includes things like an option for poster frame or setting the width and height of the viewable area. So there may be times where I focus on video and don't mention audio just because so much of what applies to video also applies to audio and in those cases you can assume that what I am talking about also applies to audio. But I'll be sure to include discussions and examples of audio whenever it would be helpful and especially wherever there are differences. So that's a pretty good background on what HTML5 video and audio are and there is a good chance a lot of that isn't new to you.

But what can be unclear is where HTML5 is in the process of becoming that primary media playback technology and what workarounds are required to make it a reality today. So next, I am going to discuss the state of HTML5 video and audio.

Show transcript

This video is part of

Image for HTML5: Video and Audio in Depth
HTML5: Video and Audio in Depth

37 video lessons · 15232 viewers

Steve Heffernan
Author

 
Expand all | Collapse all
  1. 1m 24s
    1. Welcome
      42s
    2. Using the exercise files
      42s
  2. 15m 18s
    1. Understanding HTML5 video and audio
      4m 46s
    2. The state of HTML5 video and audio
      4m 29s
    3. Understanding the format war
      3m 53s
    4. Configuring your server to deliver HTML5 media formats
      2m 10s
  3. 32m 36s
    1. Using the video and audio tags
      5m 34s
    2. Using multiple sources for browser compatibility
      5m 53s
    3. Preloading
      4m 16s
    4. Autoplaying
      2m 2s
    5. Looping
      5m 11s
    6. Setting a poster frame
      3m 43s
    7. Setting the video width and height
      3m 40s
    8. Displaying subtitles and captions
      2m 17s
  4. 12m 40s
    1. Falling back to Flash
      4m 4s
    2. Falling back to download links
      6m 21s
    3. Using an embed code builder
      2m 15s
  5. 22m 17s
    1. Understanding HTML5 video formats
      5m 10s
    2. Understanding HTML5 audio formats
      2m 57s
    3. Encoding MP4/H.264 video with HandBrake
      3m 13s
    4. Encoding Ogg, Theora, and WebM with Firefogg
      3m 18s
    5. Encoding audio formats with VLC
      5m 54s
    6. Automating video and audio encoding
      1m 45s
  6. 34m 59s
    1. Setting up the JavaScript
      4m 39s
    2. Creating Play and Pause buttons
      7m 52s
    3. Creating a Play Progress bar
      5m 49s
    4. Creating a Load Progress bar
      9m 29s
    5. Creating a Current Time and Duration display
      7m 10s
  7. 4m 37s
    1. Overview of known issues
      35s
    2. Autobuffer or preload?
      56s
    3. Load progress in Firefox 3.6
      41s
    4. Android 2.0 issues
      1m 5s
    5. iOS 3 issues
      1m 20s
  8. 2m 8s
    1. Flight of the Navigator
      50s
    2. ZEN Audio Player by simurai
      34s
    3. The Wilderness Downtown by Google and Arcade Fire
      44s
  9. 1m 40s
    1. Further exploration
      1m 40s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed HTML5: Video and Audio in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.