HTML5 Doctor » track http://html5doctor.com helping you implement HTML5 today Tue, 18 Aug 2015 18:11:14 +0000 en-US hourly 1 Review: HTML5 Multimedia: Develop and Design https://stevefaulkner.github.io/html5doctored/review-html5-multimedia-develop-and-design/ https://stevefaulkner.github.io/html5doctored/review-html5-multimedia-develop-and-design/#comments Tue, 28 Aug 2012 17:03:18 +0000 http://html5doctor.com/?p=4744

Related Posts:

]]>
With a number of HTML5 books now available, we’re starting to see them cover more specific areas of HTML5. HTML5 Multimedia: Develop and Design, written by fellow HTML5 Doctor Ian Devlin, focusses on native multimedia in HTML5. Read my review below to find out what it’s all about.

Disclosure: Ian is a friend of mine (though I’ve never met him in real life, so I can’t actually confirm he exists), an HTML5 Doctor, and a fellow curator of HTML5 Gallery. This review isn’t biased though. It’s an honest opinion of the book.

I’ve been meaning to write this review since the book came out — and before Ian joined the surgeons on this site — but I didn’t get around to it. Thankfully much of the book is still relevant.

Although Ian’s book is primarily about HTML5 multimedia, he actually covers much more, including brief introductions to new HTML5 elements, parts of CSS3, canvas, SVG, and WebSockets whilst linking them all back to native multimedia. It’s a comfortable length, easy to read, has solid examples, and dives into lots of detail in places. There’s useful, practical information regarding such things as MIME types and MP4 profiles and other gotchas that you don’t always see in other books and articles. And the best thing: Ian has tested all this himself and not relied on someone else’s word.

Cover of HTML5 Multimedia: Develop and Design Book

HTML5 Multimedia: Develop and Design, by Ian Devlin

The book starts with an introduction to HTML5, including a potted history and some detail about many of the new elements. You can probably skip this chapter if you know a bit about HTML5.

The second chapter is dedicated to the history of web-based multimedia. Ian manages to tell the story in detail without making it boring. I found the web multimedia history lesson very interesting as it reminded me of the pains we endured making sites in the early days of the web. This chapter also introduces the four main multimedia elements (<audio>, <video>, <source>, and <track>) covered in the book, along with their associated attributes.

Chapters 3 and 4 cover <audio> and <video> and their attributes in further detail. It’s well-written and easy to understand with good humour expressed throughout the examples. Ian does perhaps gloss over some of the downsides, such as having to encode and host files multiple times, particularly for commercial sites (although it is mentioned in passing in Chapter 4). This is understandable, though, as native multimedia is still overall a big win for developers and users.

For video in particular, there’s good coverage of media queries and media types and even caveats for Android (or targeting other devices and serving appropriate content). Ian also includes a helpful tip about qtindexswapper that you may have seen in Ian’s recent Multimedia Troubleshooting article.

The next chapter covers the media API. It’s a simple and easy-to-follow introduction for someone (like me) who doesn’t write a lot of JavaScript. Ian shows how to script your own controls, amongst other things. It would’ve been nice to see complete code examples at the end of each section, so you could see exactly where each portion of the script fits in relation to the others.

Chapters 6 and 7 cover styling with CSS. If you’re up to speed with CSS3, then you should find it all simple enough. There’s all your standard rounded corners, gradients, and shadow shizzle included. The object properties and transitions and animation are also covered, which are good to know about.

I do have to question the value of these chapters for readers. Perhaps it’s beneficial for those with little knowledge of CSS, but overall these chapters feel too long and take up a large portion of content that could have been used to explore the API or accessibility (“a11y”) in more detail.

Speaking of a11y, that’s covered in Chapter 8. It includes a thorough introduction to WebVTT, the <track> element, and keyboard interaction. I would have liked to see Ian dig a little deeper and look at other a11y areas that are appropriate to multimedia.

Ian then looks at using video with canvas and SVG. He includes some useful ideas such as taking a screenshot using canvas or grey-scaling a video. For SVG, there are some excellent tips about masking and animating masks over video using SVG shapes (plus a brief intro to SVG for those who haven’t used it). He introduces SVG filters, but it was unclear to me how I link the SVG filters to the actual video files. Again, I think complete final examples would have been good to see here.

The book closes with a useful overview of where native multimedia is heading and introduces a number of new APIs coming soon (or already here in some cases) to a browser near you.

Summary

In summary, the book is easy to read and has an appropriate level of detail throughout with good examples to supplement the explanation. I’d definitely recommend this book to anyone who’s looking to do more with HTML5 Multimedia than simply add it to a site as you see in a lot of tutorials.

Review: HTML5 Multimedia: Develop and Design originally appeared on HTML5 Doctor on August 28, 2012.

]]>
https://stevefaulkner.github.io/html5doctored/review-html5-multimedia-develop-and-design/feed/ 3
Video: the track element and webM codec https://stevefaulkner.github.io/html5doctored/video-the-track-element-and-webm-codec/ https://stevefaulkner.github.io/html5doctored/video-the-track-element-and-webm-codec/#comments Thu, 24 Jun 2010 13:45:42 +0000 http://html5doctor.com/?p=2089

Related Posts:

]]>
There are a couple of interesting developments in the world of HTML5 multimedia that you’ll be interested in. The first is the new <track> element (currently only in the WHAT-WG spec due to political stuff).

<track> is a child of a <video> or <audio> element that links to a timed track, or time-based data. The kind of data is set via a kind attribute, which can take values of subtitles, captions, descriptions, chapters or metadata, depending on the type of information you’re adding to your media. These point to a source file containing timed text that the browser will expose via some kind of user interface, if the visitor requires additional data.

This will allow for “write once, use everywhere” accessibility; anyone linking to that file with a <video> or <audio> element that includes the element can access your information.

<track kind=captions src=blah.srt>

The file format is a new format called WebSRT, which competes with about 50 other timed formats, including some W3C formats (hence the omission of <track> from the W3C spec).

Added 9 July 2010: Here’s a readable overview of the SRT format.

Given that the format itself isn’t fully specified yet, it will be a while until we see implementation in browsers. But it’s good to know that there will be an official way to add accessibility information to media. Until then, I have a JavaScript hack to take timed <span>s out of an in-page transcript to superimpose over a video.

WebM video format

The big news of the last month is that Google open-sourced the VP8 video codec that it acquired when it took over On2 Technologies. When combined with the Vorbis audio codec (that Spotify uses) and wrapped in a subset of the Matroska container format, it’s collectively known as WebM.

All YouTube videos are being transcoded to WebM, and Adobe have also announced they will include it in their Flash player. It’s available in an Opera 10.60 beta, a Firefox testing build, and a Chromium dev channel. Even Microsoft have said that IE9 will support it if the codec is installed on the computer.

The VP8 video codec itself is high-quality (Google had said that Ogg Theora wasn’t good enough compression-to-quality for YouTube, but Theora was based on the VP3 precursor to VP8). It’s available for streaming too.

If you want to encode to WebM, you can try the Miro Video Converter utility. Although it doesn’t allow you to optimise settings, it’s very easy to use. As the codec becomes more widespread, expect to see many more tools for content creation, editing, and transcoding.

Once production versions of the browsers are available, you should encode your videos with WebM as the first option, Ogg for older versions of Opera, Firefox and Chrome, falling back to royalty-encumbered H.264 for Safari and links to downloads or a Flash player for legacy browsers:

<video controls>
<source src=video.webm type='video/webm; codecs="vorbis,vp8"'>
<source src=video.mp4 type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src=video.ogv type='video/ogg; codecs="theora, vorbis"'>
<!-- embed Flash here -->
<p>Your browser does not support video; download the <a href="video.webm">WebM</a>, <a href="video.mp4">mp4</a> or <a href="video.ogg">Ogg</a> video for off-line viewing.</p>
</video>

If, however, you’re having problems with the iPad, put the MP4 version first in the <source> element; apparently there’s a bug that causes the iPad only to see the first <source> element.

It’s a long haul, and it’s not over yet, but <track> and .webM show significant progress towards our goal of accessible, open, and royalty-free video playing natively in the browser.

Video: the track element and webM codec originally appeared on HTML5 Doctor on June 24, 2010.

]]>
https://stevefaulkner.github.io/html5doctored/video-the-track-element-and-webm-codec/feed/ 33