previous next

Chapter 13: Basic Timing

SMIL's timing attributes help you to tailor your presentation. You can use these attributes to adjust when clips start to play. Or you might stream just one scene from a video to create a preview without encoding a separate video clip. This chapter describes the basic SMIL timing features. Once you master these features, you can tackle advanced timing as described in Chapter 14.

Understanding Basic Timing

SMIL timing attributes are optional, giving you a powerful way to customize presentations by specifying when and how long elements play. Before you use SMIL timing attributes, though, you should know how you want to construct your overall presentation timeline. For more on this, see "Step 5: Organize the Presentation Timeline".

Note: This chapter uses the term element to indicate anything that can use a SMIL timing attribute. For simple presentations, elements are typically clip source tags like <video/> and group tags like <par>. But you can also use timing attributes in tags such as <prefetch/>, <animate/>, and <area/>.

Groups Create the Timing Superstructure

The <seq>, <par>, and <excl> group tags set the basic timing structure for a presentation. To stream a sequence of videos, for example, you do not need to use SMIL timing attributes. You simply arrange the clips in a <seq> group as described in Chapter 11. Your presentation timeline then flows automatically from the clip timelines and the group arrangement. You need to add timing attributes only if, for example, you want to add a pause between each clip, shorten the time a clip plays, or play just one scene from a clip.

Timing is Relative to Groups

In general, timing attributes for an element are relative to the group that contains the element. For elements in a <seq> group, timing attributes are relative to the end of the preceding element. For elements in a <par> or <excl> group, they're relative to the start of the group. The following example shows a sequence that consists of a parallel group followed by a video clip. For the audio clip, for example, the timing attributes are relative to the start of the <par> group:

<body>
<seq ...timing is relative to the start of the presentation...>
<par ...timing is relative to the start of the sequence...>
<textstream ...timing is relative to the start of the parallel group.../>
<audio ...timing is relative to the start of the parallel group.../>
</par>
<video ...timing is relative to the end of the preceding parallel group.../>
</seq>
</body>

Timing Attributes Covered in this Chapter

The following are the basic SMIL timing attributes described in this chapter:

Specifying Time Values

SMIL provides two methods to specify time values, a shorthand method and a "normal play time" method. Both methods provide the same capabilities. Although you can use both methods within the same SMIL file, using just one method makes authoring SMIL presentations easier.

Tip: RealOne Player displays a presentation's elapsed time in one-second increments. You can click the time-elapsed field to display time values to 1/10th of a second, however. This can help you decide what timing values you want to use with a clip.

Using Shorthand Time Values

The shorthand method is best suited for specifying short, simple timing values such as five seconds, ten minutes, or 1-1/2 hour. As demonstrated in the following table, the shorthand markers of h, min, s, and ms provide an easy way to designate a timing value for a SMIL element.

Timing Shorthand Markers and Examples
Timing Marker Specifies Example Example Value
h hours end="2.5h" 2 hours, 30 minutes
min minutes end="2.75min" 2 minutes, 45 seconds
s seconds end="15.55s" 15 seconds, 550 milliseconds
ms milliseconds end="670.2ms" 670.2 milliseconds

Tip: Decimal values are not required. You can express two seconds as "2s" or "2.0s", for example.

Using the Normal Play Time Format

The "normal play time" format for SMIL timing is suited for long, complex timing values, such as specifying one hour, fourteen minutes, 36 and 1/2 seconds. The normal play time format values use the following syntax:

hh:mm:ss.xy

where:

Only the ss field is required. When the time value does not include a decimal point, the last field is read as the seconds. For example, 1:30 means 1 minute and 30 seconds, whereas 1:30:00 means 1 hour and 30 minutes. Note that all of the following values are equivalent to 90 minutes:

begin="1:30:00.0" 
begin="90:00"
begin="5400"

Setting Begin and End Times

The begin and end attributes affect when an element starts or stops, respectively. This section explains how to use begin and end with the basic SMIL timing values. Chapter 14 describes advanced timing values that you can use with begin and end to add interactivity to a presentation.

Using a Begin Time with a Clip

Using the begin attribute, you can vary the point at which a clip starts to play back within the presentation timeline:

<video src="video1.rm" begin="20.5s"/>

Were the preceding clip in a <par> or <excl> group, it would start playing at 20.5 seconds after the group became active. The begin attribute thereby lets you stagger the starting times of clips contained in these groups. Were this clip in a <seq> group, there would be 20.5 seconds of blank time before the clip starts. The begin attribute therefore lets you insert delays into sequences.

For More Information: See also "Setting a Fill with Sequential Clips"

View it now! (requirements for viewing this sample)
This sample demonstrates basic begin values.

Using an End Time with a Clip

You can set an end attribute alone or in combination with a begin attribute as shown in the example below, which sets the clip to end at 62.7 seconds into its part of the presentation timeline:

<video src="video1.rm" begin="20.5s" end="62.7s"/>

Note that the end time is measured from the point where the clip would start if no begin time were set. To calculate how long the clip is active, subtract the begin value from the end value. In the preceding example, the clip is active a total of 42.2 seconds (62.7 minus 20.5) regardless of the length of its internal timeline. If the clip's timeline were shorter than 42.2 seconds, the clip's last frame would display until the full 42.2 seconds had elapsed.

Tip: The dur attribute gives you an alternative and sometimes simpler way to specify how long an element plays. For more information, see "Setting Durations"

Using Begin and End Times with Groups

In group tags, the begin and end attributes function much as they do in clip tags:

Setting Internal Clip Begin and End Times

The clipBegin and clipEnd attributes specify a clip's internal timing marks where playback begins and ends. They allow you to play just part of a clip that has an internal timeline, such as an audio, video, or animation clip. They have no effect on groups or static clips such as still images, though. The following example uses clipBegin and clipEnd with a video clip:

<video src="video1.rm" clipBegin="10s" clipEnd="50s"/>

Here, the clip starts playing at its internal 10-second mark rather than at its encoded beginning. It stops when it reaches its 50-second mark, having played for a total of 40 seconds.

Warning! Do not use clipBegin and clipEnd for a live broadcast or when delivering clips with a Web server. For more information, see "Limitations on Web Server Playback".

View it now! (requirements for viewing this sample)
This sample demonstrates basic clipBegin and clipEnd values.

Combining clipBegin and clipEnd with begin and end

You can combine clipBegin and clipEnd attributes with begin and end attributes. In the following sample, a begin time is added to the preceding example:

<video src="video1.rm" clipBegin="10s" clipEnd="50s" begin="5s"/>

The begin time delays the clip's normal starting point by 5 seconds. When this time elapses, the clip starts at its 10-second internal timeline marker and plays for 40 seconds, which takes it to the 50-second mark of its internal timeline. In this case, the clipEnd attribute determines how long the video is active. You could also add an end attribute to modify this behavior, as shown in the following example:

<video src="video1.rm" clipBegin="10s" clipEnd="50s" begin="5s" end="50s"/>

Combined with the begin value, the end value of 50 means that the clip's "window of activity" within the presentation is 45 seconds. Because the clip stops playing after 40 seconds, there is an extra 5 seconds during which the clip does not play but remains active and frozen onscreen. In contrast, if you used end="30", the begin and end values would set a playback time of 25 seconds, overriding the specified clipEnd time.

Setting Durations

The dur attribute controls how long an element stays active after it starts to play. The following example ends the video after 85 seconds, regardless of the length of the clip's internal timeline. If the video's timeline is shorter than 85 seconds, the video's last frame appears frozen onscreen until the duration elapses:

<video src="video1.rm" dur="85s"/>

A common use of dur is to control how long a static clip such as an image appears onscreen. Because a static clip has an intrinsic duration of zero seconds, using dur is the easiest way to set the clip's playback time. The following example displays an image for two minutes:

<img src="button1.gif" dur="2min"/>

View it now! (requirements for viewing this sample)
The first sample shows the use of a basic dur value. The second sample plays a sequence of three video previews created with dur. Clicking a preview launches the full clip in a separate window.

Choosing end or dur

In the preceding example, end="2min" would achieve the same result as dur="2min" because no begin time is used. When a begin attribute is present, you need to calculate the end value relative to the begin value. With a dur attribute, however, you just set the total duration you want. This makes dur easier to use in some cases.

For example, suppose that you want a video to play for exactly two minutes. If a begin="20.5s" value delays the video playback for 20.5 seconds, you have to calculate the end value by adding the begin value to the total playback time you want, as shown in the following example (140.5 - 20.5 = 120 seconds):

<video src="video1.rm" begin="20.5s" end="140.5s"/>

With a dur attribute, on the other hand, you just specify the total playback time, as shown here:

<video src="video1.rm" begin="20.5s" dur="2min"/>

As the preceding examples illustrate, you can use either end or dur depending on how you want to measure time for clip playback. For most simple timing needs, you use either end or dur, but not both. If an element includes both end and dur, the attribute that specifies the shorter playback time is used.

Setting a Duration for the Length of Media Playback

With clips that have internal timelines, you can use dur="media" to set the clip's duration to the length of its internal timeline. This is useful only when you include another timing value, such as an end attribute. Consider the following example:

<video src="video1.rm" end="10min" dur="media"/>

Because this clip uses both end and dur, the attribute specifying the shorter playback time is used. Suppose the video clip normally runs 15 minutes. In this case, end="10min" ends the clip after 10 minutes. But if the clip runs just 5 minutes, dur="media" ends the clip when it finishes its normal playback. If you did not have dur="media" in this case, the end="10min" value would keep the clip active an additional 5 minutes, unnecessarily lengthening playback.

Using an Indefinite Duration

You can use dur="indefinite" to extend an element's duration indefinitely. As with dur="media", dur="indefinite" is typically used with another timing attribute that ends the element. For example, the following clip stays active indefinitely until the viewer clicks the image with the ID stop:

<par>
<ref src="..." dur="indefinite" end="stop.activateEvent" region="play"/>
<img src="..." id="stop" dur="10s" fill="freeze" region="stopbutton"/>
</par>

When an element has an indefinite duration, RealOne Player's timeline slider does not operate because the presentation's end time cannot be known in advance. Hence, viewers cannot seek through the presentation. The timeline slider will work, though, if a group timing attribute overrides the element's indefinite duration. For example, if you added dur="10min" to the <par> tag in the preceding example, RealOne Player's timeline slider would operate and indicate a presentation lasting ten minutes.

For More Information: Chapter 14 explains the advanced timing commands that let you end a clip on a certain event, such as when another clip is clicked.

Tips for Setting Durations

Setting Minimum and Maximum Times

This section to be added.

Ending a Group on a Specific Clip

By default, a <par> or <excl> group ends when all elements in the group finish playing. You can modify this behavior with the endsync attribute. Suppose a long clip of background music plays in parallel with a shorter RealText clip. Using endsync, you can stop the group when the RealText clip finishes, cutting off the background music once the text has displayed. The endsync attribute has no effect in <seq> tags or clip source tags. The following table lists the endsync values.

endsync Attribute Values
Value Function Reference
all Ends the group once all clips have finished. click here
first Ends the group when the first clip finishes. click here
ID Ends the group when a specific clip finishes. click here
last Ends the group when the last clip finishes. This is the default. click here

Stopping a Group After the Last Clip Plays

The two values endsync="last" and endsyc="all" are similar. Both end a <par> or <excl> group when the last clip finishes playing. (Here, "last" refers to playback times and not the order that clips are listed in the group.) Because the default value is endsync="last", you do not need to add this value to the group tag explicitly.

In the following example, the group behavior would be the same if you used just the <par> tag. Here, the parallel group concludes when the video ends, as long as the video plays more than two minutes. If the video has a shorter duration, the group ends when the image clip's two-minute duration expires:

<par endsync="last">
<video id="vid1" src="video1.rm" region="video_region"/>
<img src="banner.png" region="banner_region" dur="2min"/>
</par>

When all group elements use basic timing values, as in the preceding example, endsync="all" functions just like endsync="last". The difference between these values arises only when elements in the group use interactive timing values, which are described in Chapter 14. Consider the following example of an exclusive group in which each clip plays only when a button is clicked:

<excl endsync="all">
<video src="video1.rm" begin="button1.activateEvent" .../>
<video src="video2.rm" begin="button2.activateEvent" .../>
<video src="video3.rm" begin="button3.activateEvent" .../>
</excl>

In this case, using a group tag of <excl> or <excl endsync="last"> would not work. When this exclusive group starts, no clips are active because playback depends on the viewer clicking a button. The default value of endsync="last" immediately ends the group in this case. The endsync="all" value keeps the group active until all clips in the group have played, however. In the preceding example, the group ends after the viewer has clicked all three buttons to play all three videos.

For More Information: Exclusive groups are described in "Creating an Exclusive Group". The section "Defining a Mouse Event" explains the activateEvent timing value.

Stopping the Group When a Specific Clip Finishes

The values endsync="first" and endsync="ID" can stop a <par> or <excl> group when a specific element stops playback. Use endsync="first" to stop the group when the first element in the group stops playing. (Note that "first" refers to playback times and not the order that elements are listed in the group.) All other elements in the group stop playing at that point, regardless of their playback statuses or any timing parameters specified for them.

The attribute endsync="ID" causes the group to conclude when the designated element ends playback. All other elements in the group stop playing at that point, regardless of their playback statuses or any timing parameters used with them. The designated element must have a corresponding id value in its source tag, as illustrated in the following example:

<par endsync="vid1">
<video id="vid1" src="video1.rm" region="video_region"/>
<textstream src="moreinfo.rt" region="text_region"/>
</par>

Note: Because all, first, last, and media are endsync values, do not use these words as clip IDs when using endsync="ID".

Tips for Using the endsync Attribute

Repeating an Element

Using a repeat attribute, you can specify how many times, or for how long, an element repeats. You can also make an element repeat indefinitely. The following table summarizes these attributes.

Repeat Attributes
Attribute Value Function Reference
repeatCount integer|indefinite|
fractional_value
Repeats the clip the specified number of times, or indefinitely. click here
repeatDur time_value|
indefinite
Repeats the clip the specified amount of time. click here

Repeating an Element a Certain Number of Times

The repeatCount attribute repeats an element a specific number of times. You can use integer values such as 2 or 4 to specify an exact number of repetitions. You can also use decimal values to stop the clip during a repetition. In the following example, the video plays 3-1/2 times:

<video src="video1.rm" repeatCount="3.5"/>

Repeating an Element a Specific Amount of Time

The repeatDur attribute repeats an element for a specified amount of time. Like a begin, end, or dur attribute, the repeatDur attribute uses a standard SMIL timing value, as described in "Specifying Time Values". When you use repeatDur, the element repeats as many times as it can within the specified time, shown in the following example as five minutes:

<video src="video1.rm" repeatDur="5min"/>

The repeatDur attribute functions like end, so if you include a begin time, the total playback time is the repeatDur value minus the begin value. For example, the following clip is active within the presentation timeline for five minutes, but it does not play during the first minute. Its repeating cycles then last a total of four minutes:

<video src="video1.rm" begin="1min" repeatDur="5min"/>

Specifying the Length of Each Repeating Cycle

A dur attribute included with repeatCount or repeatDur sets the total time that must elapse before the element repeats. For example, each repetition of the following clip lasts three minutes. Because the clip plays twice, the total playing time is six minutes:

<video src="video1.rm" repeatCount="2" dur="3min"/>

If the video in the preceding example has an internal timeline longer than three minutes, the video stops after three minutes and immediately repeats, playing again for just three minutes. If the video runs less than three minutes, its last frame appears frozen until the full three minutes have elapsed.

Setting a Total Playback Time

An end attribute sets the total playback time during which an element can repeat. You can use it with or without dur. For example, the repeatCount, dur, and end values in the following tag cause the clip to play one cycle in three minutes, repeat, then stop after playing a total of five minutes. This places the end of playback at two minutes into the second cycle:

<video src="video1.rm" repeatCount="2" dur="3min" end="5min"/>

Looping Playback Indefinitely

An indefinite value used with a repeatCount or repeatDur attribute causes an element to repeat until another timing attribute or user event stops the loop. In the following example, the audio clip repeats continuously until the viewer clicks the RealOne Player Stop button:

<audio src="song.rm" repeatCount="indefinite"/>

As explained in "Specifying the Length of Each Repeating Cycle", a dur attribute can set the length of each repeating cycle. In the following example, each loop lasts 30 seconds:

<audio src="song.rm" repeatDur="indefinite" dur="30s"/>

Using the indefinite value for an element in a sequence prevents the sequence from ending unless the <seq> tag itself specifies the end time with a dur or end attribute. With a <par> group, you can use endsync="ID" to stop the group when an element other than the looping element finishes. In the following example, the audio loop stops when the RealPix slideshow concludes:

<par endsync="pix">
<audio src="background.rm" repeatDur="indefinite"/>
<ref src="promo.rp" id="pix" region="images_region"/>
</par>

For More Information: See "Ending a Group on a Specific Clip" for more information on endsync.

Stopping a Clip's Encoded Repetitions

For clips such as animated GIF images, you can halt the clip's native repetitions by adding mediaRepeat="strip" to the clip's source tag:

<img src="image.gif" dur="20s" mediaRepeat="strip"/>

Although the mediaRepeat="strip" attribute stops a clip from repeating, it does not necessarily render a clip static. For example, an animated GIF image may consist of ten unique frames that play in sequence, with the sequence repeating indefinitely. If mediaRepeat="strip" is used, the ten unique frames play in sequence once, but do not repeat.

Once you strip out a clip's native repetitions, you can use timing attributes to set a different pattern of repetition. Suppose that a GIF image shows one frame every second for ten seconds, then repeats this cycle indefinitely. To add a delay of five seconds between each cycle, you can use the attributes shown in the following example:

<img src="image.gif" mediaRepeat="strip" dur="15s" repeatDur="indefinite"/>

In this example, the mediaRepeat attribute strips out the GIF image's native repetitions. The dur attribute sets the repeating cycle to 15 seconds, meaning the image animates as normal for 10 seconds, then pauses for five seconds. The repeatDur attribute makes this 15-second cycle repeat indefinitely.

View it now! (requirements for viewing this sample)
In this sample, a continuously looping animated GIF first plays normally. The same GIF repeats with its native looping stripped out, and SMIL timing used to set each repeating cycle.

Managing Bandwidth with Repeating Clips

When you repeat a clip streamed with RTSP or HTTP, each repetition consumes bandwidth because RealOne Player does not cache the clip. Alternatively, you can use CHTTP to cache a repeating clip on RealOne Player. The clip then consumes bandwidth only the first time it plays. You should use CHTTP only for small clips, however, because the clip cannot be larger than RealOne Player's cache size of a few Megabytes.

For More Information: For more information on using CHTTP, see "Caching Clips on RealOne Player".

Leaving Bandwidth Available for Repeating Cycles

When you stream with RTSP or HTTP, RealOne Player prebuffers each repetition to keep the presentation from pausing when the clip replays. The presentation therefore needs spare bandwidth for buffering the repeating cycles. To determine how much bandwidth to reserve, divide the clip's preroll by the amount of time that the clip plays in each cycle. Next, multiple that number by the clip's streaming bandwidth.

Suppose that a RealAudio clip streams at 20 Kbps, plays for 60 seconds, and requires 8 seconds of prebuffering. The reserve bandwidth is the following:

((8/60) x 20) = 2.7 Kbps

The inclusion of the reserve bandwidth sets the total streaming bandwidth requirement to 22.7 Kbps. This is OK for 56 Kbps modems, but too high for 28.8 Kbps modems, which have a 20 Kbps maximum as listed in the table "Maximum Streaming Rates".

Tip: To determine how much preroll a clip requires, open the clip in RealOne Player, and use File>Clip Properties>Clip Source to view the buffering information.

Helix Universal Server Streams Used with Repeating Clips

RealOne Player never requests more than two streams for a repeating clip. If you use repeatCount="8", for example, RealOne Player requests and plays the first stream. As it does so, it prebuffers the second, identical stream. As it plays the second stream, it requests the first stream again, prebuffering it for the third repetition, and so on.

Tips for Repeating Elements

Setting a Fill

When an element ends but is not immediately replaced by another element, you can use the fill attribute to specify whether the element disappears or remains onscreen. Useful primarily with visual clips and elements such as SMIL animations, the fill attribute does not affect audio-only clips. The following table summarizes the fill attribute values.

fill Attribute Values
Value Function Reference
auto Makes fill behavior depend on timing attributes. click here
default Lets fillDefault control the fill behavior. click here
freeze Freezes element when it finishes. click here
hold Keeps element visible until the group ends. click here
remove Makes element disappear when it finishes. click here
transition Freezes clip long enough for a transition effect to occur. This is used only with clips, and not with group tags. Chapter 16 explains the transition value. click here

The fill action comes after the clip's end time, as set by its internal timeline, or as specified by any timing values such as dur, end, repeatCount, or repeatDur. Consider the following example:

<par>
<ref src="..." id="clip_1" region="region_1" dur="3min" fill="..."/>
<ref src="..." id="clip_2" region="region_2" dur="5min"/>
</par>

The dur="3min" attribute keeps the first clip active exactly three minutes, regardless of the length of its internal timeline. The fill attribute takes effect when this duration elapses. Suppose the fill attribute freezes the clip onscreen. Because the second clip's duration makes the entire <par> group last five minutes, the first clip freezes for two minutes past its duration. The following figure illustrates this fill period.

Fill Period for Two Clips in a Parallel Group

Fill Period for Two Clips in a Parallel Group

Using an Automatic Fill

If you do not use a fill attribute with an element, and you do not set a fillDefault value in a group that contains the element, the element behaves as if fill="auto" is set. (You can also set fill="auto" explicitly.) The effect of the auto value depends on whether certain timing elements are used:

Setting a Fill with Sequential Clips

In a sequence of clips, a clip automatically disappears when it ends, so each clip already behaves as if it has a fill="remove" attribute. The fill="freeze" value affects a clip in a sequence only if the subsequent clip has a delayed start. In the following example, the second clip's begin time inserts a five-second delay before it plays. The fill="freeze" value keeps the first clip visible during the delay:

<seq>
<video src="video1.rm" region="video_region" fill="freeze"/>
<video src="video2.rm" region="video_region" begin="5s"/>
</seq>

A fill="hold" value displays a clip until the sequence ends. In the following example, an image used as a background displays first. Next, a RealText clip and video play in parallel in front of the image. Without the hold value, the image would disappear as soon as its duration elapsed. But the hold value keeps the clip visible until the entire sequence ends:

<seq>
<img src="logo.gif" region="bg_region" dur="1s" fill="hold"/>
<par>
<textstream src="titles.rt" region="text_region" fill="freeze"/>
<video src="video1.rm" region="video_region"/>
</par>
</seq>

For the last clip in a sequence, fill="freeze" and fill="hold" function similarly. They have an effect only if the <seq> tag has a dur or end value that keeps it active after all clips have played. If all clips finish playing after eight minutes, but the <seq> tag has a dur="10min" attribute, for instance, a fill="freeze" or fill="hold" attribute for the last clip keeps that clip visible for the final two minutes of the sequence.

Setting a Fill in Parallel Groups

Use fill="remove" with a clip in a <par> group to make the clip disappear when it finishes playing. In the following example, the RealText clip disappears as soon as it finishes playing. Assuming that the video clip has a longer timeline, the parallel group ends when the video finishes playing:

<par>
<textstream src="titles.rt" region="text_region" fill="remove"/>
<video src="video1.rm" region="video_region"/>
</par>

In a <par> group, fill="freeze" and fill="hold" both keep a clip visible until the group completes. In the following example, the final text block of the RealText clip stays visible when the clip finishes playing. Assuming that the video clip has a longer timeline, the parallel group ends with the video clip:

<par>
<textstream src="titles.rt" region="text_region" fill="freeze"/>
<video src="video1.rm" region="video_region"/>
</par>

Setting a Fill in Exclusive Groups

Use fill="remove" on a clip in an <excl> group to make the clip disappear when it finishes playing. In the following example, each video clip disappears as soon as it finishes playing. If a clip finishes playing before another clip becomes active, no clip is visible on the screen:

<excl>
<video src="video1.rm" region="video_region" begin="..." fill="remove"/>
<video src="video2.rm" region="video_region" begin="..." fill="remove"/>
</excl>

Use fill="freeze" to keep a clip in an <excl> group visible until another clip in the group plays. Use fill="hold" to keep the clip visible until the entire <excl> group concludes. In this case, each opaque clip needs to display in a separate region to prevent other clips from obscuring it.

Displaying a Clip Throughout a Presentation

The attribute fill="hold" keeps a clip visible only until the group that contains it ends. You can add erase="never" to fill="hold" to keep a clip visible for the entire presentation, and even after the presentation has ended. This feature, which does not work in group tags, is useful for adding a background to a presentation that contains any number of groups, as shown in the following example:

<body>
<seq>
<img src="logo.gif" region="bg_region" dur="1s" fill="hold" erase="never"/>
...other groups and clips...
</seq>
</body>

In the preceding example, the background clip is listed as the first element in a sequence that contains other clips and groups. The fill and erase values keep the background clip visible while the subsequent clips and groups play.

Summary of Common Clip fill Values

Although the fill attribute can be used for groups and other elements such as SMIL animations, the most common use is with clips inside of groups. The following table summarizes how the most commonly used fill values affect clips that display in <seq>, <par>, and <excl> groups.

fill Attribute Values for Clips in <seq>, <par>, and <excl> Groups
Clip Attributes Group Function
fill="remove" <seq> Clip disappears when it stops playing.
<par> Clip disappears when it stops playing.
<excl> Clip disappears when it stops playing.
fill="freeze" <seq> Clip freezes after playback only for the duration of the subsequent clip's begin value, such as begin="5s".
<par> Clip freezes until the entire <par> group concludes.
<excl> Clip freezes until another clip in the <excl> group plays.
fill="hold" <seq> Clip freezes until the entire <seq> group concludes.
<par> Clip freezes until the entire <par> group concludes. Identical to fill="freeze".
<excl> Clip freezes until the entire <excl> group concludes.
fill="hold"
erase="never"
<seq> Clip displays throughout the presentation.
<par> Clip displays throughout the presentation.
<excl> Clip displays throughout the presentation.
fill="transition" <seq> Clip freezes long enough for the transition effect to occur.
<par> Clip freezes long enough for the transition effect to occur.
<excl> Clip freezes until another clip in the group plays, then remains long enough for the transition effect to occur.

For More Information: See "Using Clip Fills with Transition Effects" for more information on fill="transition".

Setting a Group Fill

You can also use a fill attribute with a value of remove, freeze, or hold in a group tag. Consider the following example, in which album credits and cover art display before a song plays:

<seq>
<par fill="hold">
<img src="cover.jpg" id="clip1" region="art_region" dur="20s" fill="freeze"/>
<textstream src="credits.rt" id="clip2" dur="60s" region="credits_region"/>
</par>
<audio src="song1.rm" id="clip3" dur="80s"/>
</seq>

In this example, the fill="freeze" value for the JPEG album cover keeps that clip visible as long as the <par> group is active. The <par> group itself has a fill="hold" value that keeps its final state visible until the containing <seq> group finishes. In other words, the <par> group's fill="hold" value extends the first two clips' fill periods until the <seq> group ends. The result is that the credits and cover image remain visible until the song completes, as the following illustration shows.

Clip Fill Periods Extended by a Group Fill

Clip Fill Periods Extended by a Group Fill

Tip: To set a fill value for a group and pass that value onto the elements in the group, use fillDefault instead of fill in the group tag.

Tips for Setting a Fill

Specifying a Default Fill

You can use the fillDefault attribute in a group tag to set a fill value for that group and its elements, whether those elements are clips or other groups. All elements within the group receive the default fill value unless they have another fill value explicitly set. The following table lists the possible fillDefault values.

fillDefault Attribute Values
Attribute Function Reference
auto Makes fill behavior depend on timing attributes. click here
freeze Freezes elements in the group when they finish playing. click here
hold Freezes elements in the group until the group ends. click here
inherit Makes each element inherit the fillDefault setting from the containing group. This is the default value. click here
remove Makes elements in the group disappear when finished. click here
transition Freezes clips in the group long enough for a transition effect to occur. Chapter 16 explains the transition value. click here

Adding a Default Fill to a Group

The following are the general rules for using fillDefault in a group tag:

The next example illustrates the fillDefault attribute set in a <par> group, with some of the group elements overriding the attribute value:

<par fillDefault="freeze">
<img src="logo.gif" region="bg_region" dur="1s"/>
<video src="video1.rm" region="video_region" fill="default"/>
<textstream src="titles.rt" region="text_region" fill="remove"/>
</par>

The following fill actions occur in this group:

Inheriting a Default Fill from a Containing Group

A group that does not have a fillDefault value explicitly set for it automatically inherits the fillDefault value of its containing group. The following example illustrates this inheritance with a master <par> group that contains three other <par> groups as its elements:

<par id="master_group" fillDefault="freeze">
<par id="group_X">
...clips in group_X...
</par>
<par id="group_Y" fillDefault="inherit">
...clips in group_Y...
</par>
<par id="group_Z" fillDefault="remove">
...clips in group_Z...
</par>
</par>

The following fill actions occur in this set of nested groups:


RealNetworks, Inc. ©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.
previous next