Nhúng Sounds, plug-in in HTML

Contents

What is the media

Different format of Media

1)    Sound

How many kinds to include media in website?

1)    Inline

2)    Using A Helper (Plug-In)

How to include media in website?

1)    Using The <embed> Tag

2)    Using The <object> Tag

3)    Using A Hyperlink

4)    Using Standalone Player

5)    Using ShortCode

What is Media ?

Media is everything you can see or hear: texts, music, sound, CDs, videos, records, films, etc. Media comes in many different formats. On the Internet you will find many of these elements embedded in web pages, and today's web browsers have support for a number of media formats. The support for sounds, animations and videos is handled in different ways by different browsers. Some elements can be handled inline, some requires a plug-in and some requires an ActiveX control.

When a browser sees the file extensions .htm or .html, it will assume that the file is an HTML page. The .xml extension indicates an XML file, and the .css extension indicates a style sheet. Picture formats are recognized by extensions like .gif and .jpg. Media elements also have their own file formats with different extensions.

Different format of Media

1.    Audio:

  • The Midi format: MIDI (Musical Instrument Digital Interface) is a format for sending music information between electronic music devices like synthesizers and PC sound cards. The MIDI format was developed in 1982 by the music industry. The MIDI format is very flexible and can be used for everything from very simple to real professional music making. MIDI files do not contain sampled sound, but a set of digital musical instructions (musical notes) that can be interpreted by your PC's sound card. The upside of the MIDI format is that since it contains only instructions (notes), MIDI files can be extremely small. The example above is only 23K in size but it plays for nearly 5 minutes. The MIDI format is supported by many different software systems over a large range of platforms. MIDI files are supported by all the most popular Internet browsers. Sounds stored in the MIDI format have the extension .mid or .midi
  • The Real Audio format: The RealAudio format was developed for the Internet by Real Media. The format also supports video. The format allows streaming of audio (on-line music, Internet radio) with low bandwidths. Because of the low bandwidth priority, quality is often reduced. Sounds stored in the RealAudio format have the extension .rm or .ram.
  • The Wave format: The WAVE (waveform) format is developed by IBM and Microsoft. It is supported by all computers running Windows, and by all the most popular web browsers. Sounds stored in the WAVE format have the extension .wav.
  • The MP3 format (MPEG): MP3 files are actually MPEG files. But the MPEG format was originally developed for video by the Moving Pictures Experts Group. We can say that MP3 files are the sound part of the MPEG video format. MP3 is one of the most popular sound formats for music recording. The MP3 encoding system combines good compression (small files) with high quality. Expect all your future software systems to support it. Sounds stored in the MP3 format have the extension .mp3, or .mpga (for MPG Audio).

2.    Video:

  • The AVI Format: The AVI (Audio Video Interleave) format was developed by Microsoft. The AVI format is supported by all computers running Windows, and by all the most popular web browsers. It is a very common format on the Internet, but not always possible to play on non-Windows computers. Videos stored in the AVI format have the extension .avi.
  • The Windows Media Format: The 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 web browsers. Videos stored in the MPEG format have the extension .mpg or .mpeg.
  • The QuickTime Format: The QuickTime format is developed by Apple. QuickTime is a common format on the Internet, but QuickTime movies cannot be played on a Windows computer without an extra (free) component installed. Videos stored in the QuickTime format have the extension .mov.
  • The RealVideo Format: The RealVideo format was developed for the Internet by Real Media. The format allows streaming of video (on-line video, Internet TV) with low bandwidths. Because of the low bandwidth priority, quality is often reduced. Videos stored in the RealVideo format have the extension .rm or .ram.
  • The Shockwave (Flash) Format: The Shockwave format was developed by Macromedia. The Shockwave format requires an extra component to play. This component comes preinstalled with the latest versions of Netscape and Internet Explorer. Videos stored in the Shockwave format have the extension .swf.

How many kinds to include media in website ?

1.    Inline:

When sound is included in a web page, or as part of a web page, it is called inline sound. If you plan to use inline sounds in your web applications, be aware that many people find inline sound annoying. Also note that some users might have turned off the inline sound option in their browser. Our best advice is to include inline sound only in web pages where the user expects to hear the sound.

2.    Using a helper (Plug-in):

A helper application is a program that can be launched by the browser to "help" playing sound. Helper applications are also called Plug-Ins. Helper applications can be launched using the <embed> or the <object> tag. One great advantage of using a helper application is that you can let some (or all) of the player settings be controlled by the user. Most helper applications allow manually (or programmed) control over the volume settings and play functions like rewind, pause, stop and play.

How to include media in website ?

1.    Using The <embed> tag

The purpose of the <embed> tag is to embed multimedia elements in web page.



With video file, we also do the same include audio file.



That code only appropriate with some browser and some format of sound. Several require Plug-in to run that code. Some of them can run with control interface. But another run without control interface.

To overcome that problem, we can add attribute type="application/x-mplayer2" into that code.





Thông tin liên hệ:
Nguyen Lam Thi Minh Dieu
Email: dieu.nguyenlamthiminh@niit.edu.vn.
Website: www.nguyenlamminhdieu.com