The SMIL linking module defines the user-initiated hyperlink elements that can be used in a SMIL document. It describes:
XPointer [XPTR] allows components of XML documents to be addressed in terms of their placement in the XML structure rather than on their unique identifiers. This allows referencing of any portion of an XML document without having to modify that document. Without XPointer, pointing within a document may require adding unique identifiers to it, or inserting specific elements into the document, such as a named anchor in HTML. XPointers are put within the fragment identifier part of a URI.
XLink (XML Linking Language) [XLINK] defines a set of generic attributes that can be used when defining linking elements in an XML-encoded language. SMIL borrows some constructs and concepts from XLink, mostly to stay consistent with HTML. SMIL does not conform to XLink.
Both XLink and XPointer are subject to change. At the time of this document's writing, neither is a full W3C recommendation. This document is based on the public Working Drafts ([XLINK], [XPTR]). It will change when these two formats change.
SMIL 1.0 allowed authors to playing back a SMIL presentation at a particular element rather than at the beginning by using a URI with a fragment identifier, e.g. "doc#test", where "test" was the value of an element identifier in the SMIL document "doc". This meant that only elements with an "id" attribute could be the target of a link.
The SMIL Linking module defined in this specification allows using any element in a SMIL document as target of a link. In addition, we are considering supporting the use of XPointers for fragment identifiers in URIs pointing into SMIL documents. This would enable linking to elements that do not have a specified "id" attribute. For example:
The following URI selects the 4th par element of an element called "bar":
http://www.w3.org/foo.smil#id("bar").child(4,par)
Note that XPointer only allows navigating in the XML document tree, i.e. it does not actually understand the time structure of a SMIL document.
When a link into a SMIL document contains an unresolvable XPointer ("dangling link") because it identifies an element that is not actually part of the document, SMIL software should ignore the XPointer, and start playback from the beginning of the document.
When a link into a SMIL document contains an XPointer which identifies an element that is the content of a "switch" element, SMIL software should interpret this link as going to the parent "switch" element instead. The result of the link traversal is thus to play the "switch" element child that passes the usual switch child selection process.
The use of XPointer is not restricted to XLink attributes. Any attribute specifying a URI can use an XPointer (unless, of course, prohibited for that attribute's document set).
XPointer can be used in various SMIL attributes which refer to XML components in the same SMIL document or in external XML documents. These include:
The link elements allows the description of navigational links between objects.
SMIL provides only for in-line link elements. Links are limited to uni-directional single-headed links (i.e. all links have exactly one source and one destination resource).
Due to its integrating nature, the presentation of a SMIL document may involve other (non-SMIL) applications or plug-ins. For example, a SMIL browser may use an HTML plug-in to display an embedded HTML page. Vice versa, an HTML browser may use a SMIL plug-in to display a SMIL document embedded in an HTML page. Note that this is only one of the supported methods of integrating SMIL and HTML. Another alternative is to use the merged language approach. See the integration module for further details.
In embedded presentations, links may be defined by documents at different levels and conflicts may arise. In this case, the link defined by the containing document should take precedence over the link defined by the embedded object. Note that since this might require communication between the browser and the plug-in, SMIL implementations may choose not to comply with this recommendation.
If a link is defined in an embedded SMIL document, traversal of the link affects only the embedded SMIL document.
If a link is defined in a non-SMIL document which is embedded in a SMIL document, link traversal can only affect the presentation of the embedded document and not the presentation of the containing SMIL document. This restriction may be released in future versions of SMIL.
A locator that points to a SMIL document may contain a fragment part (e.g.
http://www.w3.org/test.smi#par1
). The fragment part is an id
value that identifies one of the elements within the referenced document.
There are special semantics defined for following a link containing a fragment
part into a document containing SMIL timing. These semantics are defined
in the SMIL-Boston Timing Module. In addition, the following rules apply
for linking into a document written in the SMIL language:
<a>
Element
The <a>
element has the same syntax and semantics as the
SMIL 1.0 <a>
element. The <a>
element
has SMIL-only attributes as well. For synchronization purposes, the
<a>
element is transparent, i.e. it does not influence
the synchronization of its child elements. <a>
elements
may not be nested. An <a>
element must have an "href"
attribute.
Attributes
<a>
elements.
What "end" means needs to be defined. For example, it could be when the user closes the display window or when a continuous media object ends.
The default value of the "sourcePlaystate" attribute depends on the value of the "show" attribute.
href
attribute when the link is followed.
It only applies when this resource is a continuous media object. It can have
the same values as the "sourcePlaystate" attribute.
The default value of "show" is "replace".
Element Content
The "a" element can contain the following children:
Examples
Example 1
The link starts up the new presentation replacing the presentation that was playing.
<a href="http://www.cwi.nl/somewhereelse.smi"> <video src="rtsp://foo.com/graph.imf" region="l_window"/> </a>
Example 2
The link starts up the new presentation in addition to the presentation that was playing.
<a href="http://www.cwi.nl/somewhereelse.smi" show="new"> <video src="rtsp://foo.com/graph.imf" region="l_window"/> </a>
This could allow a SMIL player to spawn off an HTML browser:
<a href="http://www.cwi.nl/somewebpage.html" show="new"> <video src="rtsp://foo.com/graph.imf" region="l_window"/> </a>
Example 3
The link starts up the new presentation and pauses the presentation that was playing.
<a href="http://www.cwi.nl/somewhereelse.smi" show="new" behavior="pause"> <video src="rtsp://foo.com/graph.imf" region="l_window"/> </a>
Example 4
The following example contains a link from an element in one presentation A to the middle of another presentation B. This would play presentation B starting from the effective begin of the element with id "next".
Presentation A: <a href="http://www.cwi.nl/presentationB#next"> <video src="rtsp://foo.com/graph.imf"/> </a> Presentation B (http://www.cwi.nl/presentation): ... <seq> <video src="rtsp://foo.com/graph.imf"/> <par> <video src="rtsp://foo.com/timbl.rm" region="l_window"/> <video id="next" src="rtsp://foo.com/v1.rm" region="r_window"/> ^^^^^^^^^ <text src="rtsp://foo.com/caption1.html" region="l_2_title"/> <text src="rtsp://foo.com/caption2.rtx" region="r_2_title"/> </par> </seq> ...
<area>
Element
The functionality of the <a>
element is restricted in
that it only allows associating a link with a complete media object. The
HTML
4.0 "area" element has demonstrated that it is useful to associate links
with spatial portions of an object's visual display.
The semantics of the <area>
element in SMIL is the same
as it is for HTML in that:
<area>
element allows associating a link destination
to spatial portions of a visual object, using the "href" attribute (in contrast,
the <a>
element only allows associating a link with a
complete media object).
<area>
element allows making a subpart of the media
object the destination of a link, using the "id" attribute.
<area>
element allows breaking up an object into spatial
subparts, using the "coords" attribute.
It extends the syntax and semantics of the HTML
<area>
element by providing for linking from non-spatial
portions of the media object's display. These extensions are:
The SMIL 1.0 <anchor>
element is deprecated in favor of
<area>
.
Attributes
The <area>
element can have the attributes listed
below, with the same syntax and semantics as in HTML 4.0:
The following lists attributes that are newly introduced by this specification, and attributes that are extended with respect to HTML 4.0:
<a>
element.
<a>
element.
<a>
element.
<a>
element.
Editor Note: This functionality is preliminary. The intent of the fragment attribute is to enable linking from an embedded document back into the main SMIL presentation. Several open issues: What mechanism does the player use to insert the link into the embedded document, and what semantics must be adhered to? How does this affect the DOM event flow? What is the interaction with the "coords" attribute?
<a>
element.
<a>
element.
<a>
element.
<a>
element.
Element Content
The <area>
element is empty.
Examples
1) Decomposing a video into temporal segments
In the following example, the temporal structure of an interview in a newscast (camera shot on interviewer asking a question followed by shot on interviewed person answering ) is exposed by fragmentation:
<smil> <body> <video src="video" title="Tom Cruise interview 1995" > <seq> <area id="firstQ" dur="20s" title="first question" /> <area id="firstA" dur="50s" title="first answer" /> </seq> </video> </body> </smil>
2) Associating links with spatial segments In the following example, the screen space taken up by a video clip is split into two sections. A different link is associated with each of these sections.
<smil> <body> <video src="video" title="Tom Cruise interview 1995" > <area shape="rect" coords="5,5,50,50" title="Journalist" href="http://www.cnn.com"/> <area shape="rect" coords="5,60,50,50" title="Tom Cruise" href="http://www.brando.com" /> </video> </body> </smil>
3) Associating links with temporal segments
In the following example, the duration of a video clip is split into two sub-intervals. A different link is associated with each of these sub-intervals.
<smil>
<body>
<video src="video" title="Tom Cruise interview 1995" >
<seq>
<area dur="20s" title="first question"
href="http://www.cnn.com"/>
<area dur="50s" title="first answer"
href="http://www.brando.com"/>
</seq>
</video>
</body>
</smil>
4) Associating links with spatial subparts
In the following example, the screen space taken up by a video clip is split into two sections. A different link is associated with each of these sections.
<video src="http://www.w3.org/CoolStuff"> <area href="http://www.w3.org/AudioVideo" coords="0%,0%,50%,50%"/> <area href="http://www.w3.org/Style" coords="50%,50%,100%,100%"/> </video>
5) Associating links with temporal subparts
In the following example, the duration of a video clip is split into two subintervals. A different link is associated with each of these subintervals.
<video src="http://www.w3.org/CoolStuff"> <area href="http://www.w3.org/AudioVideo" begin="0s" end="5s"/> <area href="http://www.w3.org/Style" begin="5s" end="10s"/> </video>
6) Jumping to a subpart of an object
The following example contains a link from an element in one presentation A to the middle of a video object contained in another presentation B. This would play presentation B starting from second 5 in the video (i.e. the presentation would start as if the user had fast-forwarded the whole presentation to the point at which the designated fragment in the "CoolStuff" video begins).
Presentation A: <a href="http://www.cwi.nl/mm/presentationB#tim"> <video id="graph" src="rtsp://foo.com/graph.imf" region="l_window"/> </a> Presentation B: <video src="http://www.w3.org/CoolStuff"> <area id="joe" begin="0s" end="5s"/> <area id="tim" begin="5s" end="10s"/> </video>
7) Combining different uses of links
The following example shows how the different uses of associated links can be used in combination.
Presentation A: <a href="http://www.cwi.nl/mm/presentationB#tim"> <video id="graph" src="rtsp://foo.com/graph.imf" region="l_window"/> </a> Presentation B: <video src="http://www.w3.org/CoolStuff"> <area id="joe" begin="0s" end="5s" coords="0%,0%,50%,50%" href="http://www.w3.org/"/> <area id="tim" begin="5s" end="10s" coords="0%,0%,50%,50%" href="http://www.w3.org/Tim"/> </video>
8) Associating links with syntactic subparts
Below is an example with an integrated HTML file that displays a menu of
link one link two
The user can click on one of the menu items, and the matching HTML file is displayed (i.e., click on "link one" and the "Link1.html" file is displayed in the "LinkText" region).
The menu HTML file contains the code:
<A NAME="link1">link one</A><BR> <A NAME="link2">link two</A>
The SMIL file is:
<smil> <head> <layout> <region id="HTML" width="100" height="100"/> <region id="LinkText" width="100" top ="100"/> </layout> </head> <body> <par> <text region="HTML" src="namedanchs.html" dur="indefinite"> <area fragment="link1" href="#LinkOne"/> <area fragment="link2" href="#LinkTwo"/> </text> <excl -- or something like excl -- dur="indefinite" > <text id="LinkOne" region="LinkText" src="Link1.html" dur="indefinite"/> <text id="LinkTwo" region="LinkText" src="Link2.html" dur="indefinite"/> </excl> </par> </body> </smil>