SMIL switching gives you a powerful way to provide different clips that RealOne Player chooses between based on certain criteria. For example, you can have each RealOne Player select an audio track based on each viewer's language preference. This chapter explains how to set up switch groups to stream different clips to different audiences.
SMIL switching is a powerful means to tailor presentations for different audiences without making viewers choose which presentation they wish to view. In cases such as language choice, SMIL switching occurs automatically based on a preference the viewer has set in RealOne Player. In other cases, such as available bandwidth or monitor size, switching is based on an attribute that the viewer does not control. In all cases, however, RealOne Player automatically makes the choice without input from the viewer.
![]() |
Tip:
When you want viewers to choose options themselves, use
an <excl> tag, not a <switch> tag. For more on the <excl> tag, see
"Creating an Exclusive Group".
|
![]() |
Note: The following sections demonstrate switching with clips recorded in different languages. Keep in mind, though, that the same principles apply to switching through other criteria, such as bandwidth or monitor size. |
A switch group starts with a <switch>
tag and ends with a </switch>
tag.
Between these tags, you list multiple options, such as multiple clip source
tags, that each contain a test attribute. RealOne Player evaluates the options
in the order you list them, choosing the first option that it can play. For
example, in the following simple <switch>
group, the systemLanguage
test
attributes cause RealOne Player to choose one of two audio clips based on its
language preference:
<switch> |
Only RealOne Players in which the viewer has selected French (fr
) as the
language preference will choose the first clip. Only RealOne Players in which
the viewer has selected German (de
) as the language preference will choose the
second clip. A RealOne Player with another language preference will not play
either clip: it simply ignores the clips in the <switch>
group and proceeds to
the next part of the presentation. Hence, a RealOne Player either plays just one
clip from a <switch>
group, or it plays no clip. But it never plays more than one
option.
To reach the widest audience of viewers, a <switch>
group needs to have a
default option. Without this option, certain RealOne Players may not play any
clips in the group. A default option must satisfy these criteria:
Any RealOne Player will choose an option that does not include a test attribute. Hence, any RealOne Player that did not choose an option with a test attribute will choose the option without the test attribute.
<switch>
group.RealOne Player always evaluates options in the order they are listed, playing the first suitable option it finds. If you list a default option before options that include test attributes, no RealOne Player will ever evaluate the test attributes of the options following the default option.
The following example modifies the preceding example to add an English- language clip as the default choice:
<switch> |
Note that the English-language clip is listed last and does not include a
systemLanguage
test attribute, making it the default. In this example, any
RealOne Player with a preference set to a language other than French or
German will choose the English clip. For example, all RealOne Players with a
language preference for Swedish, Korean, English, and so on choose the
English-language clip.
It is not always necessary to use a <switch>
tag for switching. You can also use
inline switching, which adds test attributes to clip source tags in a <par>
or
<seq>
group. When RealOne Player encounters a test attribute, it evaluates the
attribute to determine if it should play or skip the clip. In the following
example of a parallel group, RealOne Player always plays the Flash clip, and
then chooses the French or German audio clip based on its language
preference:
<par> |
Although useful in many situations, inline switching cannot provide a default
option, making it less powerful than a <switch>
group. Consider the following
example, which attempts to add a default English-language clip to the
preceding example:
<par> |
The parallel group shown above will work for every RealOne Player, except
those with a French or German language preference! For instance, a RealOne
Player with a language preference for French plays the Flash (.swf
) clip, the
French RealAudio clip, and the English-language clip, which has no
systemLanguage
attribute that ties it to a language preference. Hence, the
viewer hears an incomprehensible blend of French and English.
Only a <switch>
tag causes RealOne Player to evaluate all options as a group
and choose only one option. The following example illustrates the correct way
to add the default, English-language choice to the parallel group shown above:
<par> |
The following table lists the test attributes available for switching. These attributes are described in detail in the remainder of this chapter.
Attribute | Value | Tests For | Reference |
---|---|---|---|
systemAudioDesc |
on|off |
descriptions preference | click here |
systemBitrate |
bits_per_second |
total available bandwidth | click here |
systemCaptions |
on|off |
captions preference | click here |
systemComponent |
component |
component or version | click here |
systemCPU |
CPU_type |
computer CPU type | click here |
systemLanguage |
language_code |
language preference | click here |
systemOperatingSystem |
OS_name |
computer operating system | click here |
systemOverdubOrSubtitle |
overdub |subtitle |
overdubbing or subtitle preference | click here |
systemRequired |
prefix |
namespace support | click here |
systemScreenDepth |
1|4|8|24|32 |
monitor color bit depth | click here |
systemScreenSize |
height X width |
monitor size | click here |
<switch>
tag must fall within the <head>
or <body>
section of your SMIL file. In other words, the <smil>
, <head>
, or <body>
tags cannot fall within a <switch>
tag.<switch>
tag in the header section to let RealOne Player choose between alternative layouts. See "Example 3: Media Playback Pane Resized for Captions" for an example of modifying the layout to accommodate system captions.<switch>
tag to switch between alternative <seq>
, <par>
, or <excl>
groups. In these cases, you add the test attributes to the group tags instead of to the clip source tags.<switch>
tags to achieve the same results. See "Multiple Test Attributes" for examples of how to use both methods.<area/>
tags inside the clip source tags, rather than with <a>
and </a>
tags around the clip tags. Add the test attribute to the clip tag, as shown here:<video src="video1.rm" systemLanguage="fr" ...> |
![]() |
For More Information:
For more on the <area/> tag, see "Using
the <area/> Tag".
|
<switch>
groups.When source clips are in different languages, use a test attribute of
systemLanguage
in the clip source tag or group tag. The following example
shows a video slideshow with separate audio narrations in French, German,
Spanish, Japanese, Korean, and English. Each RealOne Player requests the
same slideshow, but chooses an audio clip based on its language preference
(Tools>Preferences>Content) and its evaluation of the systemLanguage
values:
<par> |
The last audio option in the preceding example is the default. Because the last option does not have a test attribute, a RealOne Player that does not have French, German, Spanish, Portuguese, Japanese, or Korean set as its preferred language chooses the English clip.
![]() |
For More Information:
See the examples in "Subtitles and
HTML Pages in Different Languages" for more
demonstrations of how to use systemLanguage .
|
Appendix I lists the codes used as systemLanguage
values. In some cases, a
primary language code has variation codes. For instance, es
is the primary
code for Spanish, corresponding to Spanish as spoken in Spain. This code has
several variations, such as es-mx
for Mexican Spanish and es-pr
for Puerto
Rican Spanish. When variation codes are used, RealOne Player uses the
following rules to select a clip:
<switch/>
group. For example, a RealOne Player with a preference for Mexican Spanish plays clips designated with es-mx
or es
. If a clip with the value es
comes first, RealOne Player does not continue to evaluate options to determine if the es-mx
option is present.es
. If the only choices are es-mx
and es-pr
, for instance, this RealOne Player does not choose either option.If you have different clips for different language variations, list the clip that corresponds to the primary code as the last option, as shown here:
<switch> |
In the preceding example, RealOne Players with a preference for Mexican
Spanish (es-mx
) choose the first clip. RealOne Players with a preference for
Puerto Rican Spanish (es-pr
) choose the second clip. All other RealOne Players
with a preference for any variation of Spanish choose the last clip. For
instance, a RealOne Player with a preference for Chilean Spanish chooses the
es
option because its preferred variation (es-cl
) is not listed.
For clips in foreign languages, RealOne Player viewers can set a preference for
subtitles or overdubbing. The systemOverdubOrSubtitle
attribute tests for this
preference, displaying clips based on the viewer's choice. It can have one of two
values, either overdub
or subtitle
. Suppose that you have three versions of a
RealVideo clip:
original.rm
)dubbed.rm
)titled.rm
)You can use systemOverdubOrSubtitle
along with systemLanguage
in a <switch>
group as shown in the following example:
<switch> |
In the preceding example, RealOne Players with a preference for English and
overdubbing play the first clip. Any other RealOne Player preferring English
plays the second clip. The original French clip is listed last with no
systemLanguage
attribute. This makes it the default played by RealOne Players
that prefer French or another language besides English.
![]() |
Note:
In the preceding example, the second clip does not need
to specify subtitle explicitly. The systemOverdubOrSubtitle
attribute uses only overdub or subtitle as its value. Because the
first clip takes the overdub value, only the subtitle value is left
for the second clip.
|
To stream different clips to viewers at different connection speeds, use the
systemBitrate
test attribute to define options each RealOne Player can choose
based on the total amount of bandwidth it has available. The systemBitrate
attribute takes as a value the approximate bits per second required to stream
the whole presentation. The following sample <switch>
tag lists two different
RealPix presentations. The first is for connections that have at least 80 Kbps of
bandwidth. The second is for slower connections, down to 28.8 Kbps modems:
<switch> |
As shown above, list the bandwidth choices from fastest to slowest. RealOne Player evaluates options in order, selecting the first option it can play. If the 20,000 bps option were first, a RealOne Player with a high-speed connection would choose it because it is the first viable option. Also ensure that the last option satisfies the slowest connection speed you want to support. If the last choice is systemBitrate="60000", for example, RealOne Players on modems will not play the presentation because its bandwidth requirement is too high.
The more complex example below shows three sets of clips. Each <par>
tag has
a systemBitrate
attribute that lists the approximate bandwidth the clips as a
whole consume. Note that each group uses the same RealText clip, but has
different RealAudio and RealPix clips created for its bandwidth:
<switch> |
![]() |
For More Information: The table "Maximum Streaming Rates" gives bandwidth guidelines for various network connections. |
![]() |
Tip: Helix Producer Plus, which you can purchase and download from http://www.realnetworks.com/products/producer/index.h tml, installs a bandwidth simulator in RealOne Player that you can use to test different streaming speeds for a SMIL presentation streamed by Helix Universal Server. |
With RealAudio or RealVideo clips encoded for multiple bit rates with
SureStream technology, you may or may not need to use the <switch>
tag with
a systemBitrate
attribute. The following guidelines will help you to make this
decision:
<switch>
tag.<switch>
tag when combining a SureStream clip with other clips encoded for single bandwidths. The SureStream clip is always used, but the <switch>
group gives RealOne Player options for other clips. The following example illustrates a RealAudio SureStream clip and a choice between two RealPix presentations built for different bandwidths:<par> |
RealOne Players that have at least 47,000 bits per second of available bandwidth choose slideshow1.rp
. If this slideshow takes 25 Kbps, for example, these RealOne Players pick a SureStream track from soundtrack.rm
that requires 22 Kbps or less of bandwidth. RealOne Players with between 47,000 and 20,000 bps of available bandwidth choose slideshow2.rp
, along with a SureStream track that keeps the combined clips under 20 Kbps.
![]() |
For More Information: For more on SureStream, see "SureStream RealAudio and RealVideo". Refer to "Step 4: Develop a Bandwidth Strategy" for information on targeting certain network connection speeds. |
RealOne Player users who are sight- or hearing-impaired can set accessibility
preferences (Contents under Tools>Preferences) that give them audio
descriptions or captions when those options are available. You can match
RealOne Player viewers to these options with the systemAudioDesc
and
systemCaptions
attributes. Both attributes, which you can use together or
singly, take a value of either on
or off
. Suppose you have three versions of a
video clip:
video.rm
).video_descriptions.rm
). A video with audio descriptions might consist of a standard video that pauses intermittently while a separate audio track encoded in the clip describes upcoming scenes.video_captions.rm
). A video with captions might consist of a standard video that includes encoded captions similar to subtitles, but in the same language as the video's audio track.You can use inline switching with the systemAudioDesc
and systemCaptions
attributes as shown in the following example to choose between clips based on
the viewer's accessibility preference:
<seq> |
![]() |
For More Information: See "System Captions Using RealText" for an example of using RealText to provide system captions. |
Several <switch>
tag attributessystemCPU
, systemOperatingSystem
,
systemScreenSize
, and systemScreenDepth
let you switch between clips or
groups based on the viewer's computer hardware or software. This lets you
tailor a presentation's size or clip types, for example, based on the features of
the machine running RealOne Player.
The systemCPU
attribute lets you switch clips based on the processor for the
RealOne Player computer. This attribute identifies the computer processor
but no other machine attributes, such as the computer's clock speed, available
memory, or operating system. The following table lists the possible values for
the systemCPU
attribute.
![]() |
Note:
The preceding table lists all systemCPU attribute values
defined for SMIL. This does not mean, however, that RealOne
Player is available for each hardware platform.
|
The systemOperatingSystem
attribute lets you switch clips based on the
operating system running on the RealOne Player computer. This attribute
does not discriminate between various versions of an operating system,
however. The following table lists the values for systemOperatingSystem
. The
last column indicates if a version of RealOne Player is available for that
operating system. Note, however, that RealOne Player availability is subject to
change.
Two test attributes, systemScreenSize
and systemScreenDepth
, let you switch
clips based on the size and color capability of the monitor displaying RealOne
Player. They are useful if you have different versions of the same video in
different sizes or different color depths, for example.
The systemScreenSize
attribute uses a pixel measurement value in the form
height
X
width
. The value specifies that the monitor displaying RealOne Player
must be of the given size or larger. The following are common systemScreenSize
values:
![]() |
Note: You must use a capital "X". Note, too, that monitor sizes are commonly referred to in a width-by-height format, such as 640-by-480. With SMIL, though, you must specify height first. |
Because a monitor must be at least the specified size for RealOne Player to
choose an option, always list options from the largest to the smallest screen
size as shown above. If you listed systemScreenSize="480X640"
first, for example,
all RealOne Players on standard desktop computers would choose that option
because all standard desktop monitors are at least that size.
![]() |
Tip:
Keep in mind that computer users can generally set their
monitor resolutions differently. Some 17-inch monitors may
have a resolution of 768X1024 for example, while others are set
to 600X800 .
|
The systemScreenDepth
attribute uses an integer value that specifies the color
bit depth of the monitor. The monitor must have the given bit depth or higher
to play the clip. The following are common systemScreenDepth
values:
32 |
millions of colors |
24 |
millions of colors |
16 |
thousands of colors |
8 |
256 colors |
4 |
16 colors |
1 |
black-and-white |
Because a monitor must have at least the specified color depth for RealOne
Player to choose an option, always list options from the highest bit depth to
the lowest as shown above. If you listed systemScreenDepth="8"
first, for
example, all RealOne Players on standard color monitors would choose that
option because all standard color monitors can display at least 256 colors.
Using the systemRequired
and systemComponent
attributes, you can define an
element that plays only if RealOne Player (or another SMIL-based media
player) is above a specific version number, or possesses a certain component,
such as a plug-in required to render a clip. The following sections describe how
to use these attributes within SMIL 2.0, and how to use them to provide
backward-compatibility with SMIL 1.0.
The following abstract example illustrates how systemRequired
and
systemComponent
attributes work in SMIL 2.0:
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" |
The <switch>
tag in this example enables RealOne Player to choose between
two clips, the second of which is a default choice that plays if RealOne Player
does not meet the requirements of the first clip.
The <smil>
tag in the preceding example defines a customizations namespace
that is specific to the media player being tested:
xmlns: |
A customizations namespace is required because the systemComponent
attribute values are different for each media player. For example, the
systemComponent
value that tests for the version number of RealOne Player is
different from a systemComponent
value that tests for the version number of a
different SMIL-based media player. The namespace defines the values that the
media player can expect to encounter for systemComponent
.
![]() |
For More Information: For more on namespaces, see "Using Customized SMIL Attributes". |
The systemRequired
attribute takes as a value the prefix for the customizations
namespace. This is necessary because a media player that does not handle a
certain attribute, such as a specific systemComponent
value, ignores the
attribute but still plays the element. The systemRequired
attribute overrides
this default behavior, making the media player ignore the element entirely if
the player does not recognize the customizations namespace.
The systemComponent
attribute selects a component or property that RealOne
Player or another media player must possess, such as a certain version number.
The values are specific to each media player.
![]() |
Note:
A later version of this manual will describe components
and properties that you can test for in RealOne Player.
Currently, the primary use of systemComponent is to add SMIL
2.0 features to a SMIL 1.0 file, as explained in the next section.
|
The previous section describes how to use systemComponent
and systemRequired
within a SMIL 2.0 environment. This section explains how you can use
systemComponent
and system-required
(the SMIL 1.0 version of systemRequired
)
to create a file that plays as SMIL 1.0 in RealPlayer 7 and RealPlayer 8 (but not
RealPlayer G2), and contains enhanced SMIL 2.0 features for RealOne Player.
This lets you add SMIL 2.0 features to existing SMIL 1.0 files, for instance.
![]() |
Tip: Because of the many differences between SMIL 1.0 and SMIL 2.0, RealNetworks does not recommend creating a complex SMIL file that plays as SMIL 2.0 in RealOne Player and as SMIL 1.0 in RealPlayer 7 and 8. Use this backward- compatible method only for adding a small number of SMIL 2.0 features to existing SMIL 1.0 presentations. Otherwise, create separate SMIL 1.0 and 2.0 files. |
To add SMIL 2.0 functionality to a SMIL 1.0 file, you use systemComponent
and
system-required
to test the player version on each SMIL 2.0 element. This
enables RealPlayer 7 and 8 to ignore the element. The following example
modifies the SMIL 2.0 example in the preceding section, adding the attributes
and values that are specific to testing for the RealPlayer version number:
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" |
In this example, each player has a choice of two clips specified by <ref/>
tags.
The first <ref/>
tag requires that the player be version 6.0.10 (RealOne Player)
or later. Earlier versions of RealPlayer choose the second, default option.
To test for the RealPlayer version number, you must include the following
namespace. Be sure to use the cv
prefix, too. In SMIL 2.0, prefixes are user-
definable. For RealPlayer 7 and 8, however, the cv
prefix is required:
xmlns:cv="http://features.real.com/systemComponent" |
Note that the preceding example also declares the SMIL 2.0 namespace:
xmlns="http://www.w3.org/2001/SMIL20/Language" |
RealPlayer 7 and 8 do not recognize the SMIL 2.0 namespace, so they ignore it and play the file as SMIL 1.0. Because of this namespace, though, RealOne Player plays the file as SMIL 2.0, letting you add SMIL 2.0 features.
The system-required
attribute is the SMIL 1.0 version of systemRequired
. It
ensures that the media player recognizes the customizations namespace. If the
player doesn't, it ignores the element entirely.
The systemComponent
attribute in the preceding example uses the cv
prefix of
the customizations namespace, and specifies that the player must be version
6.0.10 or later, which is the major version number for RealOne Player. The
syntax is specific to RealNetworks media players, and should be entered
exactly as shown:
cv:systemComponent="http://features.real.com/?component;player=6.0.10" |
![]() |
For More Information: See "Backward-Compatible SMIL File" for an example of how to add SMIL 2.0 transparency extensions to a SMIL 1.0 file. |
The following examples illustrate different ways to use switching. Note that there are many applications for switching, and many ways to write SMIL presentations that include switching. To view more examples, get the zipped HTML version of this guide as described in "How to Download This Guide to Your Computer", and view the Sample Files page.
Using multiple test attributes in a <switch>
group, you can have RealOne
Player choose clips based on combined criteria, such as both available
bandwidth and language preference. There are two ways to do this:
In the following example, the first two RealAudio clips have two test attributes
eachone for language and one for bandwidth. Both attributes must be viable
for RealOne Player to choose the clip. Because RealOne Player evaluates the
<switch>
choices from top to bottom, selecting the first viable option, the last
two choices do not have language attributes. This lets all RealOne Players
other than those with French selected as their language preference choose
between the two English-language clips, based on their available bandwidth:
<switch> |
The next example adds RealText clips in both French and English to the
presentation possibilities. Here, <switch>
groups are nested so that RealOne
Players with French set as their language preference play the French RealText
clip and choose from the set of French-language RealAudio clips, based on
available bandwidth. All other RealOne Players play the English RealText clip
and choose from the set of English-language RealAudio clips:
<switch> |
As described in "Different Clip Dimensions for Different Bandwidths", you can encode different sizes of the same video, streaming a small clip over slow modems and a larger clip (or clips) over faster connections. Reducing the video size for slower connections ensures that the video's frame rate and visual quality remain high. For example, you could create the three clips listed in the following table.
In the following example, each <switch>
tag test attribute uses the target bit
rate of its clip's slowest SureStream stream. The <switch>
tag then presents the
three RealVideo choices to RealOne Player from fastest to slowest:
<switch> |
![]() |
For More Information: Target bit rates are listed in the table "Maximum Streaming Rates". |
The section "Switching Between Language Choices" explains the basics of
using systemLanguage
to play different clips based on viewer language
preferences (Tools>Preferences>Content). The following examples show how to
augment a video clip with RealText subtitles in different languages, and how
to display different pages in the related info pane based on language choice.
The following sample SMIL file defines a small text region that overlays the bottom portion of a video clip. Inline switching displays RealText subtitles if the viewer has a language preference set to any variation of French or Spanish. Viewers preferring other languages see only the video:
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" |
![]() |
For More Information:
In the preceding sample, the
rn:backgroundOpacity attribute is used on the RealText clips to
render their backgrounds partially transparent. For more on
this attribute, see "Creating Transparency in a Clip's
Background Color". Chapter 6 explains RealText.
|
![]() |
View it now!
(requirements for viewing this sample)
This first sample overlays a video with semi-transparent French or Spanish subtitles if you set your RealOne Player language preference to any variation of French or Spanish, respectively. The second sample is similar in function, but opaque subtitles display below the video. |
Because SMIL lets you control HTML pages from your media, it's easy to
display different HTML pages in different languages based on the viewer's
language preference. The following sample, which omits the SMIL header,
automatically displays one of three different HTML pages in the related info
pane. The first page appears if the viewer prefers French. The second page
displays for Spanish speakers. The third page, which has no systemLanguage
attribute, is the default choice that appears for all other viewers:
<body> |
Note that the body of this SMIL file consists of just one clip source tag
(<video>...</video>
). Within these tags, a switch group (<switch>...</switch>
)
contains three hyperlinks (<area>...</area>
). Once RealOne Player chooses a
hyperlink based on the viewer language preference, the linked page opens
automatically, setting the related info pane's size.
![]() |
For More Information: To find out more about SMIL links that open HTML pages, see "Linking to HTML Pages". |
![]() |
View it now!
(requirements for viewing this sample)
This sample demonstrates language switching for HTML pages. The same clip plays, but a different related info page appears if you set your RealOne Player language preference to French, Spanish, Japanese, or Swedish. |
As the section "Enhancing Presentation Accessibility" explains, you can use
the systemCaptions
attribute to display captions for hearing-impaired viewers.
A viewer can turn on the captions preference by giving the Tools>Preferences
command, then selecting the Content pane.
The following examples demonstrate various ways to display RealText
captions for an audio track, but you can use any type of clip to provide
captions. The systemCaptions="on"
attribute simply tells RealOne Player to play
a certain clip if the viewer has turned the captions preference on. There are no
requirements for what type of clip to use for captions, though.
![]() |
Tip: Captions are different from subtitles. Captions, which are typically in the same language as the clip audio, are meant for hearing-impaired viewers who have set the captions preference on. Subtitles are for all viewers, and are generally in languages different from the clip audio. You can display subtitles based on the viewer's language preference, which is described in "Switching Between Language Choices". |
![]() |
For More Information: Chapter 6 explains how to write a RealText clip. See Chapter 12 for information about layouts. |
Although it may not be suitable in all cases, the simplest way to provide
captioning is to overlay a clip with a RealText clip that has a background
rendered transparent or semi-transparent through the rn:backgroundOpacity
attribute. To do this, you define two regions, one for the video, and one for the
captions, using the z-index
attribute to ensure that the captions appear in
front, as shown in the following example:
<layout> |
You then play the RealText clip in parallel with the main clip, using
systemCaptions="on"
to display the RealText clip only in RealOne Players that
have a preference for system captions. Because system captions are either on or
off, you can easily use inline switching (no <switch>
tag), as shown here:
<par> |
![]() |
For More Information:
For more on rn:backgroundOpacity , see
"Adjusting Clip Transparency and Opacity"
|
![]() |
View it now!
(requirements for viewing this sample)
This sample overlays a video with captions when the systems captions preference is turned on. If the preference is turned off, just the video displays. |
If you do not want to overlay the video as described in the preceding example, you can create a separate region for the captions through your SMIL file layout. The following layout is similar to that used in the preceding example, except that the captions region appears below the video region rather than on top of it:
<layout> |
If you play a video in parallel with a captions clip as shown in the preceding example, the captions region would appear blank for viewers who have the captions preference turned off. Alternatively, you can create a "filler clip" that displays in the captions region when captions are off. This clip might simply thank the viewer for watching the presentation. The following example demonstrates how to do this:
<par> |
![]() |
View it now!
(requirements for viewing this sample)
This sample creates a separate captions area that displays filler text if the captions preference is turned off. |
This example demonstrates how to use systemCaptions
in <layout>
tags to
change layouts depending on whether or not captions are displayed. The
following layout creates a captions region only when captions are turned on.
Note that in each layout, the video region has a unique ID, which is required
by SMIL. But both video regions have the same name:
<switch> |
![]() |
Tip:
Although the preceding example uses systemCaptions in the
<layout> tag, you could use the attribute in <root-layout/> and
<region/> tags instead to display or hide individual regions
based on RealOne Player's captions setting.
|
In the SMIL body, you then assign clips to the regions. Note that the following
markup assigns the single video clip to a region through the region name
instead of the region ID. If you didn't use the region name, you'd need to
create two <video/>
tags, one assigned to video_region1
, the other assigned to
video_region2
. Each tag would require a systemCaptions
attribute to turn the
tag on or off depending on the captions preference. With the following
method, only the RealText clip uses the systemCaptions
attribute:
<par> |
![]() |
For More Information: See "Setting Region IDs and Names" for more on region names. |
![]() |
View it now!
(requirements for viewing this sample)
This sample resizes the media playback pane and displays captions if the captions preference is turned on. The next, more sophisticated sample includes buttons that let the viewer resize the captions. Here, resizing is accomplished through SMIL animations. |
The section "Combining SMIL 2.0 with SMIL 1.0" explains the basics of using
systemComponent
and system-required
to create a SMIL 1.0 presentation for
RealPlayer 7 and 8 that includes enhanced SMIL 2.0 features for RealOne
Player. This sample guides you step-by-step through the process of adding a
semi-transparent GIF logo to a video clip. In RealPlayer 7 and 8, which do not
support transparency, only the video plays. In RealOne Player, the logo
appears in front of the video in the lower-right corner of the media playback
pane. The following is the SMIL 1.0 file that plays the video:
<smil> |
![]() |
To update the preceding SMIL 1.0 file: |
<smil>
tag.You need to add the namespaces for SMIL 2.0 and the RealNetworks extensions, which provide support for transparency. RealPlayer 7 and 8 ignore these namespaces. All players starting with RealPlayer 7 recognize the systemComponent
namespace, however:
<smil xmlns="http://www.w3.org/2001/SMIL20/Language" |
![]() |
Note:
In presentations played by RealPlayer 7 and 8, the cv
prefix for the systemComponent namespace is required.
|
The preceding SMIL 1.0 file contains a single video region, so the GIF logo requires another region. Even though the updated file is technically SMIL 2.0, it uses SMIL 1.0 layout features, as well as SMIL 1.0 attribute names like background-color
. Although you could add SMIL 2.0 layout features such as subregions, you'd need to hide them from earlier players. It's therefore easier to use a SMIL 1.0 layout, which is forward-compatible with SMIL 2.0 and RealOne Player:
<layout> |
![]() |
For More Information: For information about SMIL 1.0 attributes, see RealSystem iQ Production Guide for Release 8. |
The SMIL 1.0 file's content consists of a video clip. To display the logo, you play the video and the GIF image in parallel. The system-required
and cv:systemComponent
attributes ensure that the logo clip is played only by a RealNetworks media player with a version number of at least as high as 6.0.10, which is the RealOne Player major version number. To RealPlayer 7 and 8, the body contains just the video clip:
<body> |
![]() |
For More Information:
For details about rn:mediaOpacity , see
"Adjusting Clip Transparency and Opacity".
|
Always test your presentation by opening it in RealOne Player to verify that the SMIL 2.0 features are present, and in RealPlayer 7 or 8 to ensure that backward-compatibility works. You will need a separate computer for each version of RealPlayer you test.
![]() |
View it now!
(requirements for viewing this sample)
This sample demonstrates a backward- compatible SMIL 2.0 file. With RealOne Player, a semi- transparent logo appears over the video. In RealPlayer 7 or 8, only the video appears. |
As noted in "Using a SMIL File as a Source", a SMIL file can use another
SMIL file as a source clip. Combining this feature with switching gives you a
powerful means for splitting your presentation into separate SMIL files. You
can then avoid writing a single SMIL file with complex <switch>
groups
around its many elements. For example, your master SMIL file may look like
this:
<smil xmlns="http://www.w3.org/2001/SMIL20/Language"> |
This main SMIL file defines no layout, title, author, or copyright. The body
consists entirely of a <switch>
group. The first SMIL file in the group plays
only if the viewer's RealOne Player has French as its preferred language setting.
The next three SMIL files play for viewers preferring Spanish, Japanese, or
Swedish, respectively. The last file plays for all other viewers. Each referenced
SMIL file defines its own layout, content, and timing, and may have additional
<switch>
groups to play different content if, for example, the viewer requests
system captions.
![]() |
View it now!
(requirements for viewing this sample)
This sample displays a different video and related info page if your language preference is set to French, Spanish, Japanese, or Swedish through Tools>Preferences>Content. |
![]() |
©2002 RealNetworks, Inc. All rights reserved.
For more information, visit RealNetworks Click here if the Table of Contents frame is not visible at the left side of your screen. |