HTML and CSS Reference
In-Depth Information
MIME Types
Embedded objects are not limited to audio and video files. They also can be used for other
objects such as images, interactive programs, and even other Web pages. A
Multipurpose
internet Mail extensions (MiMe) type
identifies the type of data contained in a file and
provides information about how that data should be interpreted. One common MIME type
you've used since Tutorial 1 is
text/css
, which identifies a text file as containing CSS
style declarations. As you saw in the previous example, the MIME type for MP3 files is
audio/mpeg
. Figure 7-12 lists the MIME types for other sound file formats and players.
Figure 7-12
audio MiMe types
Format
File Extension
MIME Type
AU
.au
audio/basic
MIDI
.mid
audio/mid
MP3
.mp3
audio/mpeg
Ogg Vorbis
.ogg
audio/ogg
RealAudio
.ra
audio/x-pn-realaudio
SND
.snd
audio/basic
Shockwave Flash
.swf
application/x-shockwave-flash
WAV
.wav
audio/wav
Using the
embed
Element
• To embed an object using the
embed
element, add the code
<embed src=”
url
” type=”
mime
”
width=”
value
” height=”
value
” />
to the HTML file, where
url
is the filename and location of the media clip, the
type
attribute indicates the type of media file, and the
width
and
height
attributes specify
the width and height of the embedded object in pixels, respectively.
You'll add an
embed
element to the
Royal Wedding
page, nesting it within the audio
clip you created in the last set of steps.
To add the embedded object:
◗
1.
Return to the
jumbo.htm
file in your text editor and add the following code, as
shown in Figure 7-13:
<embed src=”overture.mp3” type=”audio/mpeg”
height=”20” width=”250” />
Figure 7-13
adding the embed element
embedded object
for browsers t
hat do
not support the
HTML audio element