Pronounced "smile," SMIL stands for Synchronized Multimedia Integration Language. It is an international standard for delivering multimedia presentations, providing many features for laying out and timing clips. Using SMIL when delivering RealAudio or RealVideo clips from a Web server is optional, but it can provide many useful features such as the bandwidth selection feature described here.
|
|
Additional Information |
|---|
| For a full explanation of SMIL and its many features, see the SMIL chapter in RealSystem G2 Production Guide. |
When you encode a set of single-rate clips for different bandwidths, you can use SMIL to specify the bandwidths. Your Web page then needs just one link to the SMIL file rather than a separate link to each clip. When a visitor to your Web page clicks the SMIL link, that user's RealPlayer reads the bandwidth choices and chooses the clip to play based on its bandwidth preference. This preference is set during RealPlayer installation and is also available on the Connection tab under the Options>Preferences command.
When you encode a RealAudio or RealVideo clip, you choose a clip bandwidth in the RealProducer wizard dialog. Encode as many clips from the same source file as necessary to support the bandwidths you want to target. You might encode a clip for 28 Kbps modems, another for 56 Kbps modems, and a third for dual-ISDN connections, for example. Save each clip with a different file name. Once you have encoded all the clips you want, you are ready to create your SMIL file.
Write your SMIL file with any word processor or text editor that can save files as plain text. Base your file on the following example, which shows a complete SMIL file that enables RealPlayer to choose between six clips encoded for different bandwidths:
<smil>
<body>
<switch>
<ref src="myclipcm.rm" system-bitrate="220000"/>
<ref src="myclipcl.rm" system-bitrate="150000"/>
<ref src="myclipdi.rm" system-bitrate="80000"/>
<ref src="myclipsi.rm" system-bitrate="45000"/>
<ref src="myclip56.rm" system-bitrate="32000"/>
<ref src="myclip28.rm" system-bitrate="20000"/>
</switch>
</body>
</smil>
The following table explains this example. It shows that myclipcm.rm is for fast cable modems. The "SMIL File Bit Rate Specification" column lists the figures to use as the system-bitrate values. For a 28.8 Kbps clip, for example, use 20000 to indicate that 20,000 bits per second is the minimum bandwidth needed to play the clip. This is below the full connection speed (28.8 Kbps, which equals 29491 bps) because a clip does not consume the entire connection bandwidth. Some bandwidth is reserved for network overhead, data loss, and so on.
Of course, your SMIL file can support a different number of bandwidths and use different file names. For example, the following SMIL file supports 28 Kbps and 56 Kbps modem connections:
<smil>
<body>
<switch>
<ref src="audio56.rm" system-bitrate="32000"/>
<ref src="audio28.rm" system-bitrate="20000"/>
</switch>
</body>
</smil>
In this example, users with 28.8 Kbps modems receive the clip audio28.rm. Users with 56 Kbps modems or faster connections receive the clip audio56.rm.
Save your SMIL file with the file extension .smil (recommended) or .smi. The file can have any name, such as myclips.smil. Make sure that when you save the SMIL file as plain text, your text editor does not add the extension .txt. If this happens, rename the file from the operating system.
Keep the following important points in mind when creating a SMIL file.
RealPlayer evaluates SMIL bandwidth options in the order listed, selecting the first viable option even if subsequent options suit it better. Therefore, always list clips from highest bandwidth to lowest, as shown in the examples above. If a 28.8 Kbps option is first, for example, a RealPlayer with a fast dual-ISDN connection will choose that option because it is the first viable option listed.
Also ensure that the last option satisfies the lowest bandwidth connection you want to support. If you do not list an option suitable for 28.8 Kbps modems, for example, RealPlayers connected through those modems will not play any of the clips.
The src attributes in the SMIL file examples above list only the clip file names, as shown here:
<ref src="audio56.rm" system-bitrate="32000"/>
These examples assume that the clips and the SMIL file are in the same Web server directory. If your clips are not in the same directory as the SMIL file, give the full URL to the clips within the SMIL file. Here's an example:
<ref src="http://www.company.com/media/audio56.rm" system-bitrate="32000"/>
SMIL has a more rigid syntax than HTML. Using authoring practices common to HTML can create an unusable SMIL file. Observe these syntax pointers when writing a SMIL file:
<REF SRC="audio56.rm" System-Bitrate="32000"/>
|
|
Tip |
|---|
| RealNetworks recommends that you always use lowercase file names for clips and the SMIL file. |
<ref src=audio56.rm system-bitrate=32000/>
ref tags end with a forward slash. Leaving out this slash, as in the following examples, makes the SMIL file unplayable:
<ref src="audio56.rm" system-bitrate="32000">
|
|
Additional Information |
|---|
| For more on SMIL file syntax, see the technical blueprint, RealSystem G2 Syntax Style Guide. |