Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Media

HTML Multimedia


Multimedia on the Web refers to sound effects, music, video, and animation.

Modern web browsers already support many multimedia formats.


What is Multimedia?

Multimedia comes in many different formats. It can be anything you hear or see: text, pictures, music, sound effects, recordings, movies, animations, and so on.

On the Internet, you will often find multimedia elements embedded in web pages. Modern browsers support a variety of multimedia formats.

In this tutorial, you will learn about different multimedia formats and how to use them in your web pages.


Browser support

The first Internet browsers supported only text, and even that support was limited to a single font and a single color. Later, browsers emerged that supported colors, fonts, and text styles, and image support was added as well.

Different browsers handle support for sound effects, animation, and video in different ways. Some elements can be handled inline, while others require additional plug-ins.

You will learn more about plug-ins in the following chapters.


Multimedia Formats

Format Multimedia elements (such as video and audio) are stored in media files.

The most common way to determine a media type is to look at the file extension. When a browser gets a file with the extension .htm or .html, it assumes the file is an HTML page. The .xml extension indicates an XML file, and the .css extension indicates a style sheet. Image formats are identified by .gif or .jpg.

Multimedia elements also have file formats with different extensions, such as .swf, .wmv, .mp3, and .mp4.


Video Formats

| pic_video | MP4 is a new video format introduced for the Internet.

 YouTube 推荐使用 MP4 。       

   

 Flash Players 支持 MP4       

   

 HTML5 支持 MP4。 |

| --- | --- |

Format file Description
AVI .avi The AVI (Audio Video Interleave) format was developed by Microsoft. All computers running Windows support the AVI format. It is a very common format on the Internet, but non-Windows computers cannot always play it.
WMV .wmv The Windows Media format was developed by Microsoft. Windows Media is common on the Internet, but Windows Media movies cannot be played without additional (free) components installed. Some later Windows Media movies cannot be played on any non-Windows computer because no suitable player is available.
MPEG
  • .mpg
  • .mpeg
  • | MPEG (Moving Pictures Expert Group) format is the most popular format on the Internet. It is cross-platform and supported by all the most popular browsers. | | QuickTime | .mov | The QuickTime format was developed by Apple. QuickTime is a common format on the Internet, but QuickTime movies cannot be played on Windows computers without additional (free) components installed. | | RealVideo | | The RealVideo format was developed by Real Media for the Internet. This format allows video streaming under low-bandwidth conditions (online video, Internet TV). Because low bandwidth is prioritized, quality is often reduced. | | Flash | | The Flash (Shockwave) format was developed by Macromedia. The Shockwave format requires an additional component to play. However, this component comes pre-installed in browsers such as Firefox or IE. | | Mpeg-4 | .mp4 | Mpeg-4 (with H.264 video compression) is a new format for the Internet. In fact, YouTube recommends using MP4. YouTube accepts many formats and converts them all to .flv or .mp4 for distribution. More and more video publishers are switching to MP4 as the Internet sharing format for the Flash player and HTML5. |
    Note The latest HTML5 standard supports only MP4, WebM, and Ogg video formats.

    Sound Formats

    MP3 is an audio compression technology. Its full name is Moving Picture Experts Group Audio Layer III, abbreviated as MP3. It was designed to greatly reduce the amount of audio data. If your site is music-oriented, you can choose the mp3 format.

    Format file Description
    MIDI
    • .mid
    • .midi
    • |

      MIDI (Musical Instrument Digital Interface) is a format for electronic musical devices (such as synthesizers and sound cards). MIDI files do not contain sound, but contain digital music instructions that can be played by electronic devices (such as sound cards).

      Click here to play The Beatles。

      Because the MIDI format contains only instructions, MIDI files are extremely small. The example above is only 23k in size but can play for nearly 5 minutes. MIDI is supported by a large amount of software on a wide range of platforms. Most popular web browsers support MIDI.

      | | RealAudio | | The RealAudio format was developed by Real Media for the Internet. This format also supports video. It allows audio streaming under low-bandwidth conditions (online music, Internet radio). Because low bandwidth is prioritized, quality is often reduced. | | Wave | .wav | The Wave (waveform) format was developed by IBM and Microsoft. It is supported by all computers running Windows and all web browsers (except Google Chrome). | | WMA | .wma | The WMA format (Windows Media Audio) has better quality than MP3 and is compatible with most players, except iPod. WMA files can be transmitted as a continuous stream of data, which makes them practical for Internet radio or online music. | | MP3 | | MP3 files are actually the sound portion of MPEG files. The MPEG format was originally developed by the Moving Picture Experts Group. MP3 is the most popular of these sound formats for music. It is expected that future software systems will all support it. |
      Note The latest HTML5 standard supports MP3, WAV, and Ogg audio formats.