A SMIL file can define links to other media. A video might link to a second video, for example. When the viewer clicks the link, the second video replaces the first. Or the video could link to an HTML page that opens in the viewer's browser. You can even define areas as hot spots with links that vary over time. The bottom corner of a video can link to a different URL every ten seconds, for instance.
SMIL provides two hyperlink tags, both found in HTML. So if you are familiar
with HTML linking, you'll pick up SMIL linking quickly. The SMIL <a> tag is
the simpler means of creating hypertext links, but the <area/> tag is more
powerful. The <area/> tag includes all features of <a>, and provides additional
ones, such as the ability to create hot spots (image maps) and timed links.
Using the <area/> tag for all hyperlinks is recommended, but the <a> tag is also
available to provide basic linking functions.
| For More Information: The two sections "Creating a Simple Link", and "Using the <area/> Tag", provide the basic instructions for using the two link tags. |
Your SMIL file can link to HTML pages that open in the RealONE Player environment (Windows only), or the viewer's default browser. The RealONE Player environment offers three types of browsing windows in addition to the viewer's default browser, as illustrated in the following figure.
The media window plays clips and SMIL presentations only. It does not display HTML page content.
The context window can display HTML pages that supplement media clips with title and copyright information, for example. This window appears only if you explicitly open an HTML page in it through a specially configured URL.
The main browsing window can attach to, or detach from, the media and context windows. When attached, it appears below the media and context windows. Detached, it functions as a stand-alone window. You can display any HTML page associated with your presentation here.
RealONE Player can display any number of stand-alone, secondary browsing windows. You can display any HTML pages associated with your presentation in secondary browsing windows instead of the main browsing window.
| Tip: Because all of the browsing windows within the RealONE Player environment use the viewer's Internet Explorer browser (version 4.0 or higher), they can display HTML, Javascript, and ActiveX content. |
| For More Information: The section "Selecting a Browsing Window" explains the attributes that target the RealONE Player browser windows. |
A hyperlink can also open in the RealONE Player media window, targeting an existing SMIL region, replacing the current presentation, or popping up a new media window. Note, though, that SMIL offers features that you can use in place of hyperlinking. For example, you can pop up a new window during the course of a presentation by using SMIL layout tags. With advanced timing, you can start or end a clip when the viewer clicks another clip. Neither of these features requires hyperlinks. So before you define hyperlinks, be sure that you understand the possibilities offered by SMIL.
| For More Information: The section "Linking to Streaming Media" lists the attributes and values specific to streaming media links. |
A hyperlink can pop up a new RealONE Player media window when clicked,
You can also pop-up a window with a <topLayout> tag as described in
"Secondary Media Windows". Defining secondary media windows is
appropriate when you want the new window to pop up at a predefined point
in your presentation. Creating a hyperlink to a new RealONE Player media
window is preferable when you want the new window to pop up based on
viewer interaction, and the media you display in the window is not part of
your main SMIL presentation.
If you plan to create an interactive application, you need to consider carefully
whether to provide interactivity through hyperlinks, <excl> groups, or both.
Suppose that you plan to create a presentation that offers three different
video clips that the viewer can select by clicking three buttons. You can author
your SMIL presentation in different ways:
Using hyperlinks, you can link each button to a separate video. In this case, your main SMIL file does not contain <video/> tags that refer to the video clips. Instead, each button uses a hyperlink to play the clip when the button is clicked. This method works well when you want to launch each video in a separate window.
<excl> group, and use advanced timing commands to play each video when the viewer clicks a button.Within an <excl> group, you include a <video/> tag for each video clip. You then use advanced SMIL timing attributes to play each video clip when the viewer clicks one of the buttons. This method is preferable if you want to display all buttons and clips in a single media window, or you want to include SMIL timing and layout attributes in each <video/> clip source tag.
For More Information:
For more on the <excl> tag, see "Creating
an Exclusive Group". Chapter 13 explains advanced timing
features.
|
The screen pointer turns into a hand icon when the viewer moves the pointer over an active link in the RealONE Player media window. Typically, the viewer opens the link by clicking it. SMIL lets you define other ways to open a link, too. You might specify a keyboard key that the viewer can press to open the link, for instance. Links can also open automatically, letting you display different Web pages as a presentation plays, for example.
| For More Information: See "Defining Basic Hyperlink Properties" for more information about these features. |
<area/> tags with a single clip source tag, however.longdesc attribute in a clip source tag, using it to describe the hyperlink destination. See "Using a Long Description" for more information.The simplest type of link connects an entire source clip to another clip. As in
HTML, you define the link with <a> and </a> tags. But whereas you enclose
text between <a> and </a> in HTML, you enclose a clip source tag between <a>
and </a> in SMIL:
<a href="rtsp://realserver.example.com/video2.rm"> |
The preceding example links the source clip video.rm to the target clip
video2.rm. When the viewer clicks video.rm as it plays, video2.rm replaces it. In
an <a> tag, the href attribute is required. The URL begins with rtsp:// if the
linked clip streams to RealONE Player from RealServer, or http:// if the file
downloads from a Web server.
| For More Information: For information on link attributes, see "Defining Basic Hyperlink Properties". See either "Linking to HTML Pages" or "Linking to Streaming Media" depending on your intended link target. |
The <area/> tag differs from the <a> tag in that you place it within the clip
source tag rather than around it. This means that you must turn unary clip
source tags such as <video/> into binary tags such as <video>...</video>. The
<area/> tag typically ends with a closing slash, but in some cases you need to
use an <area>...</area> tag pair. The following is a basic <area/> tag that links
one video clip to a second video clip:
<video src="video.rm" region="videoregion"> |
For More Information:
For more on tag pairs, see "Binary and
Unary Tags". For an example of when you must use <area> and
</area>, see "Setting the Context Window Size".
|
If the <area/> tag includes no spatial coordinates, the entire clip becomes a
link, making the <area/> tag function just like the <a> tag. A clip source tag
can include any number of <area/> tags. When you define multiple <area/>
links for a single clip, however, you need to do one or both of the following:
<area/> link is active at a different time.<area/> tag to turn each link into a hot spot that does not overlap the other hot spots.An <area/> tag can include temporal attributes that specify when the link is
active, relative to the start of clip playback. If you do not include temporal
attributes, the link stays active as long as the source clip appears onscreen. To
add timing attributes, use the SMIL begin and end values. You cannot use dur,
clipBegin, or clipEnd, however.
The following example creates two temporal links for the clip video.rm. The first link is active for the first 30 seconds of playback. The second link is active for the next 30 seconds. Because no spatial coordinates are given, the entire video is a link:
<video src="video.rm" region="videoregion"> |
Tip:
An active link is one that the viewer can open, whether by
clicking it or pressing the link's access key. The link does not
open automatically, however, unless you use actuate="onLoad".
For more information, see "Opening a URL Automatically".
|
For More Information:
See "Setting Begin and End Times". The
begin and end attributes use the SMIL timing values described
in "Specifying Time Values".
|
| View it now!
(requirements for viewing this sample)
This sample plays a clip linked to different HTML pages at different times. |
To create a hot spot with an <area/> tag, you use the shape attribute to define
the hot spot's shape, and a coords attribute to define the hot spot's size and
placement. You define the shape and coords attributes in SMIL just as you do
in HTML 4.0. The following example shows two hot spots created for a clip:
<video src="video.rm" region="videoregion"> |
How you specify the coordinate values depends on what shape (rectangle, circle, or polygon) you want, as explained in the following sections. Note that in all hot spots, the coordinates are measured from the media clip's upper-left corner regardless of where you place the clip in a region.
You can use either pixel measurements or percentages to define any hot spot. The preceding example uses pixels, whereas the following example uses percentages to place a rectangular hot spot in the center of the source clip:
<video src="video.rm" region="videoregion"> |
When a clip is a different size than its playback region, a fit="fill", fit="meet", or
fit="slice" attribute in the <region/> tag automatically resizes the clip. In these
cases, a hot spot defined with percentages scales along with the clip, whereas
one defined with pixels does not. Therefore, it's often better to use percentages
if the region's fit attribute uses the meet, slice, or fill value. It's OK to use pixel
measurements if the clip is the same size as the region, or the region's fit
attribute uses the hidden or scroll value.
For More Information:
For more on the fit attribute values, see
"Defining How Clips Fit Regions".
|
| Tip: A viewer may also resize a presentation manually by, for example, clicking and dragging a RealONE Player corner. In these cases, hot spots scale with clips whether you define the hot spots with pixels or percentages. You can prevent a clip from resizing, though, as explained in "Changing Resize Behavior". |
Use shape="rect" to create a rectangular hot spot. You then specify four coords
values in pixels or percentages to set the hot spot's size and placement,
measured from the upper-left corner of the source clip in the following order:
Coordinate values are separated by commas, as shown in the following example:
<video src="video.rm" region="videoregion"> |
The preceding example uses pixel values to define a hot spot 60 pixels wide (80 pixels minus 20 pixels) and 80 pixels high (120 pixels minus 40 pixels). It creates a hot spot like that shown in the following illustration.
| Tip: Think of the first pair of values as defining the x and y coordinates of the hot spot's upper-left corner, and the second pair of values as defining the x and y coordinates of the hot spot's lower-right corner. |
You can use shape="circle" to create a circular hot spot. Three coords values
then specify in pixels or percentages the circle's center placement and radius in
the following order:
The coordinate values are separated by commas, as shown in the following example:
<video src="video.rm" region="videoregion"> |
The preceding example uses pixel values to place the circular hot spot's center 100 pixels in from the clip's left edge, and 120 pixels down from the clip's top edge. The hot spot has a radius of 50 pixels. The following figure illustrates this example.
Tip:
The last value, which sets the circle's radius, should not be
more than the smaller of the other two values. If the first two
values are 40 and 20, for example, the third value should not be
more than 20. Otherwise, part of the circle extends beyond the
clip boundaries and is cut off.
|
Use shape="poly" to make a polygonal hot spot with any number of sides. You
might create a triangle or an octagon, for example. For every n sides of the
polygon you want to create, you must specify 2n values in the coords attribute.
To create a triangle, for example, you need to specify six coords values. Each
pair of coordinate values indicates the placement of a corner of the polygon in
this order:
The following example defines a triangular hot spot:
<video src="video.rm" region="videoregion"> |
The following figure illustrates the preceding example. The first value pair for
the coords attribute defines the triangle's lower-left corner. The coords value
pairs then proceed clockwise, defining the top corner, followed by the lower-
right corner.
| Tip: When defining a polygon, you can start with any corner, specifying the placement of additional corners by going around the polygon either clockwise or counter-clockwise. |
coords attribute. For example, the values "4%" and "4.5%" are both valid.coords attribute. For example, the attribute coords="50,50,100%,100%" places a rectangular hot spot's left and top boundaries in and down 50 pixels from the source clip's upper-left corner, respectively. But the hot spot's right and bottom boundaries extend to the source clip's right and bottom edges, respectively, no matter the source clip's size.coords="30,30,10,10" for a rectangular hot spot are ignored, and the hot spot will not function. Here, the hot spot's left side is defined as being farther to the right than its right side. As well, the top is defined to be below the bottom.coords="50,50,300,300" but the source clip is 200 by 200 pixels, the hot spot's effective coordinates are "50,50,200,200". For this reason, no percentage value can effectively be more than 100%.<area/> tag.| View it now!
(requirements for viewing this sample)
Play this sample to view separate hyperlinks defined for each quadrant of the screen. |
The hyperlink attributes summarized in the following table affect link
properties in <a> and <area/> tags whether the link opens an HTML page or a
media presentation.
| Attribute | Value | Function | Reference |
|---|---|---|---|
accesskey |
key_name |
Defines a key stroke that opens the link. | click here |
actuate |
onLoad|onRequest |
Opens the link automatically or on request. | click here |
alt |
text |
Supplies alternate text. | click here |
href |
URL |
Provides the link URL. | click here |
nohref |
(none) | Indicates no URL (<area/> tag only). |
click here |
tabindex |
integer |
Sets a tabbing order for links. | click here |
Tip:
The accesskey, alt, and tabindex attributes are defined the
same in SMIL 2.0 as they are in HTML 4.0.
|
As with an HTML hyperlink, the SMIL href attribute specifies the URL to
open. This should be an HTTP URL for items opened in a browser window,
whether those items reside on a Web server or RealServer. SMIL files or clips
opened in RealONE Player should generally have an RTSP URL if they reside
on RealServer. They must have an HTTP URL if they reside on a Web server,
however. See the following sections for more information:
<video/>, the basic URL format is the same for hyperlinks.The nohref attribute, which can be used only in <area/> tags, indicates that the
hot spot has no URL associated with it. You can use nohref with interactive
timing commands to start another clip when the hot spot is clicked, for
example. The nohref attribute does not take a value.
The accesskey attribute defines a keyboard key that the viewer can press to
open the link. The viewer presses just the defined key, and does not need to
press a helper key such as Alt to open the link. You can define any number of
access keys for a link. In the following example, the viewer could press the
keyboard letter m to open the link:
<area href="http://www.example.com" |
| View it now!
(requirements for viewing this sample)
This sample demonstrates access key hyperlinks. |
accesskey="M", for example. You can specify both the lowercase and uppercase versions of the same key, though, to ensure that letter case does not matter.longdesc attribute in the clip source tag. See "Using a Long Description" for more information.z-index value, its links override the links associated with the lower clips. However, if the upper clip uses a value of 1 to 50 for rn:mediaOpacity, its associated links do not register clicks, and the links for lower clips will open.For More Information:
For more on rn:mediaOpacity, see "Adding
Transparency to All Opaque Colors".
|
z-index stacking order does not determine the link precedence, the link that becomes active first overrides the other links.The actuate attribute has a default value of onRequest, which means the link
opens when the viewer clicks the link or presses the link's access key. If you set
actuate="onLoad", however, the link opens as soon as the link tag becomes
active in the SMIL presentation timeline, without requiring any user input.
For example, the following link opens when the video clip begins to play:
<video src="video.rm" region="videoregion"> |
Tip:
As described in "Creating a Timed Link", you can use a
begin attribute in the <area/> tag to cause the link to become
active at any point after its associated clip starts to play.
|
For More Information:
See "Displaying a Web Page when a
Presentation Ends" for an example of using actuate to open a
Web page when a presentation concludes.
|
A hyperlink can include an alt attribute that uses short, descriptive text as its
value. It is good practice always to include an alt attribute in hyperlinks. When
the viewer moves the screen pointer over the link, the alt text displays in the
status line above the RealONE Player media window, indicating what the link
will display. In the following example, the text "Introductory Video" is used for
the alt value:
<area href="..." alt="Introductory Video" .../> |
If the clip that includes the link also has an alt value, the link's alt value
displays instead of the clip's. If the link has no alt value, its URL displays in
place of the clip's alt value. In short, a link always overrides the clip's alt value.
For More Information:
The section "Including an Alternate Clip
Description" covers the alt attribute in clip source tags. See
"Coded Characters" for information on including special
characters in alt text.
|
When multiple links appear onscreen, the viewer can press Tab to cycle
between the links, then press Enter to open a link. Using the tabindex attribute,
you can specify the tabbing order. This attribute, which has a default value of
0, takes a positive integer as a value. RealONE Player highlights the clip with
the lowest tabindex value first. It highlights the clip with the next higher
tabindex value each time the viewer presses Tab. The following is an example of
two clips playing in parallel, each of which has a hyperlink:
<par> |
In the preceding example, the link for the video clip has the lower tabindex
value, so RealONE Player highlights it first when the viewer presses Tab.
RealONE Player highlights the image clip next when the viewer presses Tab
again.
Note:
If two or more <area/> tags have the same tabindex value,
the tabbing order follows the order in which the clip source
tags appear in the SMIL file. This also occurs if you leave
tabindex out of all <area/> tags.
|
The attributes summarized in the following table allow you to open HTML pages from your SMIL presentation. You can use these attributes to open a Web page while a presentation plays, for example. On Windows operating systems, Web page links open by default in browsing windows within the RealONE Player environment, though you can also open them in the viewer's default browser. On other operating systems, all HTML URLs open in the viewer's default browser.
| Attribute | Value | Default | Function | Reference |
|---|---|---|---|---|
external |
true|false |
false |
Opens link in a browser when true. |
click here |
height |
pixels |
media height | Sets context window height in <param> tag. |
click here |
rn:sendTo |
_osdefaultbrowser| |
(none) | Specifies window that opens the HTML page. | click here click here |
sourceLevel |
percentage |
100% |
Sets audio level. | click here |
sourcePlaystate |
pause|play|stop |
pause |
Changes source state. | click here |
target |
name |
current window | Targets window or frame. | click here |
width |
pixels |
330 |
Sets context window width in <param> tag. |
click here |
For a SMIL hyperlink to open in a Web browser, the external attribute must be
set to true. (The external attribute's default value is false, however, which opens
the link in the RealONE Player media window.) The link must also use an
HTTP URL that the browser can request. Minimally, a SMIL link for content
played in a Web browser looks like the following example:
<area href="http://www.example.com" external="true"/> |
Using external="true" is the only requirement for opening an HTML page in a
Web browser. As described in "Links to HTML Pages", however, RealONE
Player on Windows operating systems offers several browsing windows within
the RealONE Player environment. The following table lists the attributes
required to open an HTML URL in one of these windows.
| Attributes | Target | Reference |
|---|---|---|
external="true" |
A secondary browsing window that does not attach to the media and context windows. | click here |
external="true" |
The main RealONE browsing window, which can attach to, or detach from, the media and context windows. | click here |
external="true" |
The viewer's default Web browser. | click here |
external="true" |
The context window, which appears to the right of the media window. | click here |
| View it now!
(requirements for viewing this sample)
This sample provides an overview of RealONE Player linking, demonstrating how to use SMIL to open HTML pages in the RealONE Player context and browsing windows. |
Note the following important points about using the rn:sendTo attribute:
rn:sendTo attribute works only in SMIL <area/> tags. It does not function with <a> tags.rn:sendTo attribute works only with RealONE Player on Windows operating systems. On Macintosh and Unix computers, the rn:sendTo attribute is ignored and the links open the viewer's default browser. This also occurs in any other SMIL-based media player.rn:sendTo attribute requires that you declare the following namespace in the <smil> tag:xmlns:rn="http://features.real.com/2001/SMIL20/Extensions" |
| For More Information: For background on customized attributes and namespaces, see "Using Customized SMIL Attributes". |
The RealONE Player's main browsing window can attach to, or detach from,
the media and context windows. This is the recommended window for
displaying Web pages along with your presentation. To target this window,
declare the customized namespace in your <smil> tag as described above, and
use a hyperlink that looks like the following:
<area href="http://www.example.com" external="true" |
Tip:
To target this window from an HTML page displaying in
the context window or a secondary browsing window within
the RealONE Player environment, use <a href="URL"
target="_rpbrowser">.
|
On Windows, Web page links open in a RealONE Player browsing window by
default. Although this is preferred means for displaying these pages, you can
also open these links in the viewer's default Web browser. To do this, declare
the customized namespace in your <smil> tag as described above, and create a
link that looks like the following:
<area href="http://www.example.com" external="true" |
Appearing to the right of the media window in the RealONE Player on Windows operating systems, the context window can display HTML pages that supplement your SMIL presentation. It might display title and copyright information about clips as they play, for example. Using advanced SMIL timing features described in Chapter 13, as well as the hyperlinking features described in this chapter, you can open a URL in the context window at any time during the presentation.
To open an HTML page in the RealONE Player context window, add
rn:sendTo="_rpcontextwin" to the <area/> link tag:
<area href="http://www.example.com/context.html" external="true" |
Using this attribute requires that you declare the following namespace in the
<smil> tag:
xmlns:rn="http://features.real.com/2001/SMIL20/Extensions" |
Through <param/> tags, you can extend an <area/> tag link to include sizing
information for the RealONE Player context window. This requires that you
turn your <area/> tag into a binary tag as described in "Binary and Unary
Tags". You can then add <param/> tags to the link, as shown in the following
example, to specify the context window width and height in pixels:
<area href="..." external="true" rn:sendTo="_rpcontextwin" ...> |
| View it now!
(requirements for viewing this sample)
This sample automatically opens a series of HTML pages in the RealONE Player context window. |
height attribute in the <root-layout/> tag.<root-layout/> tag creates a presentation height of 300 pixels, for example, your context window will be 300 pixels high even if you specify a shorter height, such as 200 pixels. However, you can create a context window that is taller than your presentation, such as 400 pixels. In this case, the media window is centered vertically next to the context window.<root-layout/> tag's height and width attributes). Be careful that the combined widths of the media window and context window do not make the presentation too large to display on small computer screens.backgroundColor attribute of your SMIL presentation's <root-layout/> tag.| For More Information: For more on SMIL background colors, see "Adding Background Colors". |
sourcePlaystate="play" and actuate="onLoad" in the <area/> tag in your SMIL file.When you use SMIL to open an HTML page, the SMIL target attribute works
much the same as the HTML target attribute. When a hyperlink targets a
RealONE Player secondary browsing window (using just external="true") or the
default browser (using rn:sendTo="_osdefaultbrowser"), the target attribute can
do one of the following:
When a link specifies the main browsing window (with rn:sendTo="_rpbrowser")
or the context window (using rn:sendTo="_rpcontextwin"), the target attribute
can select an existing frame. The following example shows how to open a link
in the frame named rightpane within the main browsing window:
<area href="http://www.example.com" external="true" |
Tip:
The HTML values _new and _top are not supported in the
RealONE Player environment. Use actual window names
instead.
|
By default, the RealONE Player presentation pauses while the browser opens
the link. The viewer can resume the presentation by clicking the RealONE
Player Play button. RealONE Player typically needs to rebuffer the
presentation briefly before continuing playback. You can also make RealONE
Player stop the presentation completely, or continue playing when the link
opens, with a stop or play value, respectively, for the sourcePlaystate attribute:
<area href="http://www.example.com" external="true" |
The preceding link keeps the presentation playing as the browser opens the Web page. In this case, RealONE Player may need to rebuffer the presentation if browser operation uses too much bandwidth. To help prevent this, your streaming presentation should use less bandwidth than that listed in the table "Maximum Streaming Rates".
href attribute any additional parameters you want the browser to receive. A common use of this is linking to an anchor in an HTML page:
<area href="http://www.example.com/story.html |
sourcePlaystate="play" to keep the SMIL presentation playing while the viewer's default Web browser opens the link, you cannot prevent the browser from obscuring RealONE Player. Whether RealONE Player remains on top of other applications as it plays is entirely under the viewer's control.sourcePlaystate="play", leave a few Kbps of bandwidth available to download HTML pages, depending on the size of the HTML pages that will display. To minimize bandwidth required by the browser, link to Web pages that do not contain large graphics.sourceLevel attribute to change the RealONE Player volume when the Web page opens.When you link to another streaming media presentation, whether a SMIL file or a single clip, you can open the link URL in the existing RealONE Player media window, or pop up a new media window. The following table summarizes the attributes that you use to link to a streaming media presentation that opens in a RealONE Player media window.
| Attribute | Value | Default | Function | Reference |
|---|---|---|---|---|
href="command: |
(name, URL) |
(none) | Opens a media window from Flash or RealText. | click here |
destinationLevel |
percentage |
100% |
Sets audio level of target. | click here |
destinationPlaystate |
pause|play |
play |
Sets play state of target. | click here |
show |
new|replace |
replace |
Opens link in a new or the current window. | click here |
sourceLevel |
percentage |
100% |
Sets audio level of source. | click here |
sourcePlaystate |
pause|play|stop |
pause|play |
Sets play state of source depending on show. |
click here |
target |
ID |
(none) | Links to a specific window or region. | click here |
A link that does not include the external="true" attribute (which opens the link
in a Web browser) replaces the current presentation in the RealONE Player
media window. The source presentation is only paused, however, so the viewer
can return to it by clicking RealONE Player's Play>Previous Clip command.
Hence, an RTSP link like the following:
<area href="rtsp://realserver.example.com/video2.rm"/> |
is equivalent to the following link, in which the show, destinationPlaystate, and
sourcePlaystate attributes are explicitly set to their default values:
<area href="rtsp://realserver.example.com/video2.rm" show="replace" |
In some cases, you may want to set destinationPlaystate="pause" to keep the
new presentation from playing until the viewer clicks the RealONE Player Play
button. It's not necessary ever to include the sourcePlaystate attribute when
replacing a presentation in RealONE Player. Its value of pause is always used
with show="replace", so specifying play or stop for sourcePlaystate has no effect.
The following table summarizes the possible hyperlink attribute values for replacing a presentation in the existing RealONE Player window. The first option listed in the table is the default.
| View it now!
(requirements for viewing this sample)
In this sample, click the playing clip to replace it with a new clip in the same media window. |
You can use either the show or the target attribute to open a new media
window. The basic means for doing this is to set show="new" in the link tag.
You can open any number of new windows this way. Using show="new" does
not create a named window that you can target with another hyperlink,
however:
<area href="rtsp://realserver.example.com/video2.rm" |
By default, the current window containing the link and the new window with the target media are both set to play. Therefore, the preceding example is equivalent to the following example:
<area href="rtsp://realserver.example.com/video2.rm" show="new" |
Depending on how you want linking to operate, you can change the setting for
sourcePlaystate to pause or stop. You can also set destinationPlaystate to pause. A
common scenario is to pause the source presentation when the viewer opens
the new window. The viewer can restart the source presentation by clicking the
RealONE Player Play button. The following example illustrates this markup:
<area href="rtsp://realserver.example.com/video2.rm" show="new" |
| View it now!
(requirements for viewing this sample)
In these samples, you can click the playing clip to open a new clip in a new window and pause the first clip, or keep the first clip playing. |
Whereas show="new" opens a link in a new, unnamed media window,
target="name" creates a named window that you can select through subsequent
hyperlinks. It also lets you open linked media in a specific SMIL region of an
existing window, rather than in a new window. The show="new" attribute does
not include these two capabilities.
The target attribute takes a user-defined name as its value. As with show="new",
you can set sourcePlaystate to play, pause, or stop. You can also set
destinationPlaystate to play or pause. The following example defines a link that
opens in a SMIL region or a new window named play3:
<area href="rtsp://realserver.example.com/video2.rm" |
When RealONE Player opens the link in preceding example, it displays the linked media in the following way:
play3. That is, it looks for a SMIL region in any open window that has the play3 ID:<region id="play3" .../> |
play3 exists, RealONE Player displays the linked media in the window named play3. That is, it looks for a window created through a previous hyperlink that used a target="play3" attribute.play3 exists, RealONE Player creates a new window with the play3 name, displaying the linked media in that window.| View it now!
(requirements for viewing this sample)
These two samples each display two images linked to two separate videos. The first sample uses the target
attribute to open each video in
the same media window. The second sample uses the
target attribute to open each video in a
different media window.
|
target and show in a link, the show attribute is ignored.target exclusively to define your streaming media hyperlinks:target nor show. Replacing the presentation is the default action, so you do not need to include these attributes.target="name" to open a link in a SMIL region, or in a new or existing window.show="new" or target="name".
target="name".target="name".target="_new".fit attribute determines how the linked media appears if the region and media are different sizes. See "Defining How Clips Fit Regions" for more on fit.A SMIL file hyperlink can target a specific place in another SMIL file, or
another part of itself. To create a link of this type, you simply include the
appropriate SMIL ID in the href attribute after the URL and a pound sign (#),
just as if linking to an HTML fragment:
<area href="rtsp://realserver.example.com/movie2.smil |
The preceding link would open the designated SMIL file, and start playback at
the clip or group that included the text_and_video ID:
<par |
Note that the target SMIL file defines two regions, newsregion and textregion.
When RealONE Player receives the new SMIL file, it creates those regions as
specified in the new SMIL file's header.
You can use the <area> tag's time coordinates to create a timeline offset in a
linked clip. Suppose that you want to link a video to another video at 30
seconds into the second video's timeline. In the source SMIL file, you define a
link from the first video to a SMIL file that contains the second video. In the
second SMIL file, the video's <area> tag defines the timeline offset using SMIL
timing parameters.
Here is a sample of the link in the first SMIL file:
<video src="video.rm" region="videoregion"> |
The following is the linked video clip in the second SMIL file, newmedia.smil:
<video src="video2.rm" region="newsregion"> |
| For More Information: "Specifying Time Values" describes the SMIL timing values. |
href="#ID".<par>, <seq>, <excl>, or <switch> group by defining an id attribute for the clip or group. Do not link to an element in a SMIL file header, however, or to an element within a <switch> group.<par> group and exclude the other clips in that group. All clips in the group will play in their designated regions.Two attributes in a hyperlink tag, sourceLevel and destinationLevel, can change
the volume of the source clip and the destination clip when a link opens. If the
source clip does not stop or pause when the link opens, for example, you can
use sourceLevel to turn down the source clip's volume and boost the
destination clip's volume:
<a href="..." sourceLevel="35%" destinationLevel="125%" ...>...</a> |
The audio level attributes always use a percentage value. The default value of 100% plays the audio at its recorded volume. A value of 50%, for example, plays the audio at half its normal volume, whereas a value of 200% plays the audio at twice its normal volume.
Note that the sourceLevel and destinationLevel attributes control only the
relative volume of the audio stream sent to the speakers. They do not change
the general sound level setting on the viewer's computer, which remains
entirely under the viewer's control. All sound level adjustments are subject to
limitations in the computer hardware.
Tip:
When displaying a Web page, as described in "Linking to
HTML Pages", you can use sourceLevel to turn down or boost
RealONE Player's volume as appropriate. The destinationLevel
attribute will not affect any audio elements, such as an
embedded WAV file played by the browser, though.
|
A RealText or a Flash clip, playing alone or as part of a SMIL presentation, can
define a hyperlink that opens another clip in a new media window. This link
uses a proprietary parameter, command:openwindow(name,URL), as the value of
the href attribute. This is not a SMIL feature, and you write this parameter
directly into the RealText markup, or encode it in the Flash Player file with the
Get URL command.
The hypertext reference for this type of link has the following structure:
href="command:openwindow( |
The command:openwindow parameter requires two arguments, name and URL.
The zoomlevel argument is optional. You can separate arguments with a
comma, but this is not required. A space may precede or follow a comma. If an
argument contains characters such as commas or parentheses, enclose it in
single quotation marks.
| View it now!
(requirements for viewing this sample)
Display this scrolling RealText clip to view several hyperlinking possibilities, including opening new media windows in normal, double-size, and full-screen modes. |
The required name argument, which supplies a predefined or user-defined
name for the new media window, is the first parameter listed for
command:openwindow. The following table describes the parameter values.
Following the name argument, the required URL argument gives the fully
qualified URL to the clip or SMIL presentation to play in the new window.
You must include the protocol (rtsp://, http://, chttp://, or file://) in the URL.
Relative URLs do not work.
The optional zoomlevel=double|full|normal argument sets the new media
window to open in double-size or full-screen mode respectively. The normal
value is the default. If the operating system does not support full-screen mode,
normal mode is used instead.
| Tip: You can also open the initial presentation in double or full-screen mode by using a Ram file. For details on doing this, as well as guidelines for using double and full-screen modes, see "Setting a Presentation's Starting Mode". |
Note:
Earlier versions of RealPlayer support additional
parameters, such as autosize and ontopwhileplaying, that
RealONE Player ignores. RealONE Player is therefore
backwards-compatible with presentations developed for earlier
versions of RealPlayer. These additional parameters are
obsolete, however.
|
The following examples show how to target various windows with the
command:openwindow hyperlink syntax inRealText and Flash clips.
The following RealText link opens a URL in a new media window named
feature:
<a href="command:openwindow(feature, rtsp://realserver.example.com/comedy.rm">Comedy Hour</a> |
In Flash, the Get URL command looks like this:
command:openwindow(feature, rtsp://realserver.example.com/comedy.rm) |
When first clicked, this link creates a media window named feature. If another
link also targets the feature window, clicking that link starts the new URL in
the feature window. Clicking the link in the following example starts an
animal program in the window running the comedy program:
<a href="command:openwindow(feature, rtsp://realserver.example.com/animals.rm)">Sharks!</a> |
The Flash Get URL version looks like this:
command:openwindow(feature, rtsp://realserver.example.com/animals.rm) |
Each link opens a separate window if the window names are different, or you
use the predefined name _new or _blank. The following RealText links open
separate windows:
<a href="command:openwindow(_new, rtsp://realserver.example.com/comedy.rm)">Comedy Hour</a> |
<a href="command:openwindow(_blank, rtsp://realserver.example.com/animals.rm,)">Sharks!</a> |
In Flash, the Get URL commands look like these:
command:openwindow(_new, rtsp://realserver.example.com/comedy.rm) |
command:openwindow(_blank, rtsp://realserver.example.com/animals.rm) |
Use either _current or _self to open the URL in the current window. The
following example is for RealText:
<a href="command:openwindow(_self, rtsp://realserver.example.com/comedy.rm)">Comedy Hour</a> |
The next RealText link plays the clip at double its encoded size:
<a href="command:openwindow(_current, rtsp://realserver.example.com/animals.rm, zoomlevel=double)">Sharks!</a> |
The following are the same commands issued through Get URL in Flash:
command:openwindow(_self, rtsp://realserver.example.com/comedy.rm) |
command:openwindow(_current, rtsp://realserver.example.com/animals.rm, zoomlevel=double) |
command:openwindow and its parameters.command:openwindow link, the new clip automatically plays, and the presentation that contains the link stops. You cannot change this playback state to pause the original presentation, for example.command:openwindow is not a SMIL command, it does not offer all the SMIL linking features, such as activating automatically or on a keystroke.command:openwindow link, the SMIL link takes precedence.The following examples show different applications of hyperlinking. Choose Sample Files from the pull-down menu to view all the playable sample files included in this chapter.
Using the <area/> tag, you can easily display Web pages as a clip plays. The
following example uses advanced SMIL timing commands to open a Web page
when the video clip ends:
<video src="video1.rm" id="main" fill="freeze"> |
In this example, the hyperlink uses actuate="onLoad" to open the URL
automatically when the link becomes active. The begin="main.end" attribute
opens the link when the clip with id="main" ends. This advanced timing
feature is described in "Defining an Element Start or Stop Event".
The rn:sendTo attribute sends the URL to the RealONE Player main browsing
window, as described in "Targeting the Main Browsing Window". You can
leave this attribute out of the <area/> tag to open the URL in a secondary
browsing window. Including the rn:sendTo attribute requires that you declare
the following namespace in the <smil> tag:
xmlns:rn="http://features.real.com/2001/SMIL20/Extensions" |
| View it now!
(requirements for viewing this sample)
In this sample, an HTML page automatically opens when a clip finishes playing. |
The following markup uses a series of <area/> tags with different begin times
to open four Web pages at different points as an audio clip plays. The
actuate="onLoad" attribute causes each link to open its Web page as soon as the
link becomes active. Because the links do not use rn:sendTo="_rpbrowser" as in
the preceding example, the pages open in secondary browsing windows. The
attribute sourcePlaystate="play" keeps the clip playing as each page opens:
<audio src="audio1.rm"> |
| View it now!
(requirements for viewing this sample)
Play this sample to watch HTML pages open automatically as a clip plays. |
| Tip: Opening a Web page requires bandwidth. If your streaming media uses all of the viewer's available bandwidth, opening a Web page may cause the presentation to stall. When opening Web pages during a presentation, be sure that your streaming media uses less bandwidth than the maximum listed in the table "Maximum Streaming Rates". |
|
|
©2001 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. |