HTML5 and CSS3, Second Edition

(singke) #1
<embedsrc="awesome.mp3"autostart="true"
loop="true"controller="true"></embed>

The <embed> tag never became a standard, so people started using the <object>
tag instead, which is an accepted World Wide Web Consortium standard. To
support older browsers that don’t understand the <object> tag, you’d often see
an <embed> tag nested within the <object> tag, like this:

<object>
<paramname="src"value="simpsons.mp3">
<paramname="autoplay"value="false">
<paramname="controller"value="true">
<embedsrc="awesome.mp3"autostart="false"
loop="false"controller="true"></embed>
</object>

Not every browser could stream the content this way, though, and not every
server was configured properly to serve it correctly. Things got even more
complicated when video on the Web became more popular. We went through
lots of iterations of audio and video content on the Web, from RealPlayer to
Windows Media to QuickTime. Every company had a video strategy, and it
seemed like every site used a different method and format for encoding video
on the Web. That was inconvenient for developers and content producers,
but it was an absolute nightmare for the common user.

Macromedia (now Adobe) realized early on that its Flash Player could be the
perfect vehicle for delivering audio and video content across platforms. Flash
was available and enabled on close to 97 percent of desktop web browsers.
Once content producers discovered they could encode once and play anywhere,
thousands of sites turned to Flash streaming for both audio and video.

Then in 2007 Apple decided not to support Flash on the iPhone and iPod
Touch (and later the iPad). Because of the popularity of the iOS platform,
many of the most popular content providers, including YouTube, responded
by making available video streams that would play right in Safari on iOS.
These videos, using the H.264 codec, were also playable via the normal Flash
Player, which allowed content providers to still encode once while targeting
multiple platforms.

The creators of the HTML5 specification believe that the browser should
support audio and video natively rather than relying on a plug-in that requires
a lot of boilerplate HTML. Browsers should treat audio and video as first-class
citizens in terms of web content, just like still images. But before we look at
how to embed audio and video on pages, let’s talk about formats.

Chapter 7. Embedding Audio and Video • 132


Download from Wow! eBook <www.wowebook.com> report erratum • discuss

Free download pdf