Latest web development tutorials

HTML Media (Media)

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

Modern web browsers already support many multimedia formats.


What is multimedia?

Media from a variety of different formats. It can be anything you hear or see, text, images, music, sound, sound recording, film, animation and so on.

On the Internet, you'll often find multimedia elements embedded in Web pages, modern browsers already support a variety of multimedia formats.

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


Browser Support

The first Internet browsers only support text, and even support for text is limited to a single font and a single color. Then support the birth of colors, fonts and text styles browser, picture support has also been added.

Different browsers support different ways to deal with sound, animation and video. Some elements can be handled inline, and some will require additional plug-ins.

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


Multimedia formats

Format multimedia elements (such as video and audio) are stored in the media file.

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

Multimedia Elements Element also has a file format with a different extension, such as .swf, .wmv, .mp3 and .mp4.


Video Format

pic_video MP4 is the Internet's new video format.

YouTube recommended MP4.

Flash Players Support MP4

HTML5 support MP4.
格式 文件 描述
AVI .avi AVI (Audio Video Interleave) 格式是由微软开发的。所有运行 Windows 的计算机都支持 AVI 格式。它是因特网上很常见的格式,但非 Windows 计算机并不总是能够播放。
WMV .wmv Windows Media 格式是由微软开发的。Windows Media 在因特网上很常见,但是如果未安装额外的(免费)组件,就无法播放 Windows Media 电影。一些后期的 Windows Media 电影在所有非 Windows 计算机上都无法播放,因为没有合适的播放器。
MPEG
  • .mpg
  • .mpeg
MPEG (Moving Pictures Expert Group) 格式是因特网上最流行的格式。它是跨平台的,得到了所有最流行的浏览器的支持。
QuickTime .mov QuickTime 格式是由苹果公司开发的。QuickTime 是因特网上常见的格式,但是 QuickTime 电影不能在没有安装额外的(免费)组件的 Windows 计算机上播放。
RealVideo
  • .rm
  • .ram
RealVideo 格式是由 Real Media 针对因特网开发的。该格式允许低带宽条件下(在线视频、网络电视)的视频流。由于是低带宽优先的,质量常会降低。
Flash
  • .swf
  • .flv
Flash (Shockwave) 格式是由 Macromedia 开发的。Shockwave 格式需要额外的组件来播放。但是该组件会预装到 Firefox 或 IE 之类的浏览器上。
Mpeg-4 .mp4 Mpeg-4 (with H.264 video compression) 是一种针对因特网的新格式。事实上,YouTube 推荐使用 MP4。YouTube 接收多种格式,然后全部转换为 .flv 或 .mp4 以供分发。越来越多的视频发布者转到 MP4,将其作为 Flash 播放器和 HTML5 的因特网共享格式。

Note The latest HTML5 standard only supports MP4, WebM, and Ogg video format.

Audio Format

MP3 is an audio compression technology, which stands for Motion Picture Experts audio compression standard level 3 (Moving Picture Experts Group Audio Layer III), referred to as MP3. It is designed to greatly reduce the amount of audio data. If your site is a type of music, you can choose to mp3 format.

格式 文件 描述
MIDI
  • .mid
  • .midi

MIDI (Musical Instrument Digital Interface) 是一种针对电子音乐设备(比如合成器和声卡)的格式。MIDI 文件不含有声音,但包含可被电子产品(比如声卡)播放的数字音乐指令。

点击这里播放 The Beatles

因为 MIDI 格式仅包含指令,所以 MIDI 文件极其小巧。上面的例子只有 23k 的大小,但却能播放将近 5 分钟。MIDI 得到了广泛的平台上的大量软件的支持。大多数流行的网络浏览器都支持 MIDI。

RealAudio
  • .rm
  • .ram
RealAudio 格式是由 Real Media 针对因特网开发的。该格式也支持视频。该格式允许低带宽条件下的音频流(在线音乐、网络音乐)。由于是低带宽优先的,质量常会降低。
Wave .wav Wave (waveform) 格式是由 IBM 和微软开发的。所有运行 Windows 的计算机和所有网络浏览器(除了 Google Chrome)都支持它。
WMA .wma WMA 格式 (Windows Media Audio),质量优于 MP3,兼容大多数播放器,除了 iPod。WMA 文件可作为连续的数据流来传输,这使它对于网络电台或在线音乐很实用。
MP3
  • .mp3
  • .mpga
MP3 文件实际上是 MPEG 文件的声音部分。MPEG 格式最初是由运动图像专家组开发的。MP3 是其中最受欢迎的针对音乐的声音格式。期待未来的软件系统都支持它。

Note The latest standard HTML5 support MP3, WAV, and Ogg audio formats.