ptg16476052
386 LESSON 14: Integrating Multimedia: Video and Sound
Embedding Video the Simple Way
There’s a lot to be learned about embedding video: tags for embedding video in web
pages, new audio and video elements in HTML5, and browser incompatibilities. First,
however, it’s worth discussing the way the vast majority of videos are embedded in web
pages these days. People upload their video to a website that specializes in video hosting
or use videos that other people have uploaded and then copy and paste the code those
sites provide for embedding the videos in their own sites.
The two most popular video hosting sites, YouTube and Vimeo , provide the code to
embed the videos they host on the web pages for each video. You can see the form that
allows you to generate the embed code for YouTube in Figure 14.1.
If you want to add a video hosted on YouTube, you just click the Share button and then
choose Embed, and the form shown in the figure is displayed. If you want to customize
it, click on the Show More button and choose your customization options. Then copy the
HTML code from the box into your own page. The result is shown in F igure 14.2.
YouTube (and other sites) automatically generates the markup that you can paste into
your own web pages to embed their videos. There’s nothing magic about it; I’ll describe
the tags they use when I discuss embedding video later.
FIGURE 14.1
The embed form on
YouTube.