previous next

Appendix D: SMIL Quick Reference

Use this appendix as a reference tool when writing SMIL files. For complete information on SMIL and RealSystem, see Chapter 6. In the tables throughout this appendix, an asterisk (*) denotes a required attribute. Ellipses (...) indicate where nonessential information has been left out of examples.

Header Tags

<meta.../>

The header region's <meta.../> tags provide presentation information. A <meta.../> tag can also set a base URL for source clips in the SMIL file.

<meta.../> Tag Attributes
Attribute Value Function Reference
content * any value Provides content for the name attribute. click here
name * abstract Gives presentation abstract. click here
author Lists name of presentation author. click here
base Sets base URL for source clips. click here
copyright Supplies presentation copyright. click here
title Gives presentation title, which displays in the RealPlayer run list. click here

Note
You can define other information attributes besides abstract, author, copyright, and title. See "Adding Presentation Information".

Examples


<meta name="author" content="Jane Morales"/>
<meta name="title" content="Multimedia My Way"/>
<meta name="copyright" content="(c)1998 Jane Morales"/>
<meta name="base" content="rtsp://realserver.example.com/"/>

<layout>...</layout>

The <layout> and </layout> tags define the layout of visual clips such as video and animation. Within the tags, you define a root-layout region and separate regions for the clips. The layout must be defined in the SMIL header.

<root-layout.../>

Within <layout>...</layout>, <root-layout> sets the overall size of the playback area. Clips do not play in the root-layout area.

<root-layout.../> Tag Attributes
Attribute Value Function Reference
background-color color name or hex value Sets root-layout color. click here
height * pixels Sets playback area height. click here
system-captions on|off Determines if root-layout is created based on system captions preference. click here
width * pixels Sets playback area width. click here

Example


<layout>
<root-layout background-color="maroon" width="250" height="230"/>
<region .../>
<region .../>
</layout>

<region.../>

Within <layout>...</layout>, <region> tags define the size and placement (relative to root-layout) of each region used to play clips.

<region.../> Tag Attributes
Attribute Value Function Reference
background-color color name or hex value Sets region background color. click here
fit fill, hidden, meet, scroll, or slice Determines how clip fits region when the two are different sizes. click here
height * pixels or percentage Sets region height. click here
id * name Provides target name for setting clips to play in the region. click here
left * pixels or percentage Sets region offset from the left side of the root-layout region. click here
system-captions on|off Determines if region is created based on system captions preference. click here
top * pixels or percentage Sets region offset from the top of the root-layout region. click here
width * pixels or percentage Sets region width. click here
z-index number Defines order of overlapping regions. click here

Example


<layout>
<root-layout .../>
<region id="video" top="5" left="5" width="240" height="180"
background-color="blue" fit="fill" z-index="3"/>
<region.../>
</layout>

Clip Source Tags

To define locations and timing attributes for clips within a presentation, use one of the following source tags:


<animation.../>
<audio.../>
<img.../>
<ref.../>
<text.../>
<textstream.../>
<video.../>
<RealAdInsert.../>

Except for <RealAdInsert.../>, the choice of tag does not affect playback. All clip source tags can use <ref.../>, for example. The <RealAdInsert.../> tag is not a SMIL tag, but a RealSystem tag that RealServer replaces with a SMIL tag for an advertising clip. It does not include a src attribute, but can include any other SMIL clip attribute. These attributes get passed to the replacement tag. See Chapter 9 for more on <RealAdInsert.../>.

Clip Source Tag Attributes
Attribute Value Function Reference
abstract abstract Gives abstract for clip. click here
author name Lists author for clip. click here
begin h, min, s, or ms Delays normal playback time. click here
clip-begin h, min, s, or ms Specifies clip's internal timing mark where playback begins. click here
clip-end h, min, s, or ms Specifies clip's internal timing mark where playback ends. click here
copyright copyright Lists copyright information for clip. click here
dur h, min, s, or ms Sets total time clip plays. Do not use with end. click here
end h, min, s, or ms Sets end time for clip relative to begin time. Do not use with dur. click here
fill freeze or remove Freezes or removes (default) clip from screen when it stops playing. click here
id name Names clip for reference by other SMIL elements. click here
region <region.../> tag id name Assigns clip to a region. click here
repeat integer or indefinite Repeats the clip the specified number of times, or indefinitely. click here
src * URL Provides full or relative URL for clip. click here
system-bitrate bits per second Sets bit rate attribute for <switch>...</switch>. click here
system-captions on|off Determines if clip plays based on system captions preference. click here
system-language language code Sets language attribute for <switch>...</switch>. click here
title title Lists title for clip. click here

Examples


<video src="rtsp://realserver.example.com/media/video2.rm" region="video"
begin="40s" clip-begin="5100ms"clip-end="4.5min" fill="freeze"/>

<audio src="rtsp://realserver.example.com/media/music.rm"
dur="10.5s" repeat="5"/>

Image Source Tag Options

For a still image, you can include the following options in the image source tag. Note that these options are extensions to SMIL that work only with RealPlayer.

Image Source Tag Options
Option Value Function Reference
bgcolor color name or hex value Changes GIF transparency to color. click here
bitrate bits per second (bps) Sets streaming bit rate. click here
reliable true Guarantees reliable image transmission. click here
target _browser Makes Web browser the URL target. click here
_player Sets RealPlayer as command target. click here
url URL Sends URL to browser on mouse click. click here
command:play() Gives play command on mouse click. click here
command:pause() Gives pause command on mouse click.
command:seek(time) Makes RealPlayer seek to specified time in timeline on mouse click. Time has dd:hh:mm:ss.xyz format.
command:stop() Gives stop command on mouse click.

A question mark operator (?) separates image options from the image URL in the clip source tag. Additional options preceded by ampersands (&) can follow in this format:


<img src= "URL?option=value&option=value"/>

Note
Image options and values are not in quotation marks because they are part of the quoted src value.

Examples


<img src="ad1.gif?bitrate=1000&bgcolor=blue"/>

<img src="ad.gif?url=http://www.example.com&target=_browser" .../>

<img src="stop.gif?url=command:stop()&target=_player" .../>

<img src="seek.gif?url=command:seek(1:35.4)&target=_player" .../>

Group Tags

<par>...</par>

The <par> and </par> tags make enclosed clips play in parallel. No attributes are required for a <par> tag.

<par> Tag Attributes
Attribute Value Function Reference
abstract abstract Gives abstract for group. click here
author name Lists author for group. click here
begin h, min, s, or ms Delays normal group playback time. click here
copyright copyright Lists copyright for group. click here
dur h, min, s, or ms Sets total time group plays. click here
end h, min, s, or ms Sets end time for group relative to begin time. Do not use with endsync. click here
endsync first Ends group when first clip ends. click here
last Ends group when last clip ends.
id(clip id) Ends group when specified clip ends.
id name Names group for reference by other SMIL elements. click here
repeat integer or indefinite Repeats the group the specified number of times, or indefinitely. click here
system-bitrate bits per second Sets bit rate attribute for <switch>...</switch>. click here
system-captions on|off Determines if group plays based on system captions preference. click here
system-language language code Sets language attribute for <switch>...</switch>. click here
title title Lists title for group. click here

Examples


<par>
<video src="videos/newsong.rm"/>
<textstream src="lyrics/newsong.rt"/>
</par>

<par endsync="id(text)" repeat="2" begin="4s">
<video src="videos/newsong.rm"/>
<textstream id="text" src="lyrics/newsong.rt"/>
</par>

<seq>...</seq>

The <seq> and </seq> tags group clips that play in sequence. No attributes are required for a <seq> tag.

<seq> Tag Attributes
Attribute Value Function Reference
begin h, min, s, or ms Delays normal group playback time. click here
dur h, min, s, or ms Sets total time group plays. click here
end h, min, s, or ms Sets end time for group relative to begin time. click here
id name Names group for reference by other SMIL elements. click here
repeat integer or indefinite Repeats the group the specified number of times, or indefinitely. click here
system-bitrate bits per second Sets bit rate attribute for <switch>...</switch>. click here
system-captions on|off Determines if group plays based on system captions preference. click here
system-language language code Sets language attribute for <switch>...</switch>. click here

Example


<seq repeat="3">
<audio src="rtsp://realserver.example.com/one.rm"/>
<audio src="rtsp://realserver.example.com/two.rm"/>
</seq>

<switch>...</switch>

The <switch> and </switch> tags contain clips or groups of clips that RealPlayer chooses between based on its available bandwidth or language preference. Clips or groups that RealPlayer evaluates must include a system-bitrate or system-language attribute.

<switch> Tag Attributes
Attribute Value Function Reference
id name Names group as a link target for other SMIL files. click here

Additional Information
See "Switching Between Alternate Choices".

Example


<switch>
<audio src="french/seattle.rm" system-language="fr"/>
<audio src="german/seattle.rm" system-language="de"/>
<audio src="english/seattle.rm"/>
</switch>

Hyperlink Tags

<a>...</a>

The <a>...</a> tags work like HTML hyperlink tags to connect a media source clip to another clip. But whereas you enclose text between <a> and </a> in HTML, you enclose a media source tag between <a> and </a> in SMIL.

<a.../> Tag Attributes
Attribute Value Function Reference
href * URL Sets hyperlink URL. click here
show new Opens URL in browser while RealPlayer continues. click here
pause Opens URL in browser and pauses RealPlayer.
replace (default) Opens URL in RealPlayer.

Example


<a href="http://www.example.com/index.htm" show="new"> 
<video src="video.rm" region="videoregion"/>
</a>

<anchor.../>

An <anchor> tag can define a hot spot hyperlink that can be temporal as well as spatial. It fits within a media source tag:


<video ...>
<anchor .../>
</video>

Note that here the <video> source tag does not end with a forward slash as it normally does. Instead, a </video> tag follows it and the <anchor.../> tag.

<anchor.../> Tag Attributes
Attribute Value Function Reference
begin h, min, s, or ms Defines when hot spot becomes active or when linked media clip begins in its timeline. click here
click here
coords pixels or percentages Defines boundary for hot spot as left, top, right, and bottom offset from source clip. click here
end h, min, s, or ms Determines when hot spot deactivates. click here
href * URL Sets hyperlink URL. click here
id name Defines target for use by other hypertext links. click here
show new Opens URL in browser while RealPlayer continues playback. click here
pause Opens URL in browser and pauses RealPlayer.
replace (default) Opens URL in RealPlayer.

Examples


<video src="video.rm" region="videoregion">
<anchor href="rtsp://realserver.example.com/vid2.rm" coords="20,40,80,120"/>
</video>

<video src="video.rm" region="videoregion">
<anchor href="http://www.example.com" show="pause" coords="10,30,70,100"
begin="5s" end="45s"/>
</video>

Pop-Up Window Commands

In a SMIL hyperlink, you can include a command:openwindow argument with the following options to open the link target in a new RealPlayer window. These extensions to SMIL work only with RealPlayer 7 and later.

Pop-up Window Attributes
Attribute Value Function Reference
(name) * _new Opens URL in a new RealPlayer window. click here
_blank
_self Opens URL in the current window.
_current
name Opens URL in a new RealPlayer window that has the given name.
(URL) * URL Provides URL for the new clip or presentation. click here
autosize true Puts new window in autosize mode. click here
false Opens new window in compact mode. (Default)
zoomlevel normal Plays clip at its normal size. (Default)
double Doubles clip size.
full Plays clip at full-screen.
ontopwhileplaying true Keeps new window on top of other windows.
false Lets user control window placement. (Default)

The syntax for a pop-up window in an <a> or <anchor> tag looks like the following, with name and URL coming first and second as single statements rather than as attribute=value pairs:


<a href="command:openwindow(name, URL, playmode=value, ...)">...</a>

Examples


<a href="command:openwindow(_new, rtsp://realserver.example.com/animals.rm,
autosize=true, ontopwhileplaying=true)">
<img src="launch_button.gif" region="button"/>
</a>

<video src="rtsp://realserver.example.com/video/video1.rm" region="video">
<anchor href="command:openwindow(popup,
rtsp://realserver.example.com/video/video2.rm, zoomlevel=double)"
coords="0,0,25%,25%"/>
</video>


Copyright © 1998-2000 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 12/12/00 at 15:34:17.
previous next