The SMIL Linking module defines the SMIL document attributes and elements for navigational hyperlinking. These are navigations through the SMIL presentation that can be triggered by user interaction or other triggering events. 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).
The SMIL Linking module is divided into Levels 0, 1, and 2. Level 0 includes a set of attributes used to provide SMIL Linking semantics to linking elements, Level 1 includes the SMIL Linking elements themselves, and Level 2 includes additional optional linking features that a language profile may wish to include. Note that Level 1 explicitly includes the attributes from Level 0 on its elements.
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. The SMIL specification does not require that browsers be able to process XPointers in SMIL URI attributes.
The SMIL Linking Module supports name fragment identifiers and the '#' connector. The fragment part is an id value that identifies one of the elements within the referenced SMIL document. With this construct, SMIL supports locators as currently used in HTML (that is, it uses locators of the form "http://foo.com/some/path#anchor1"), with the difference that the values are of unique identifiers and not the values of "name" attributes. Of course, this type of link can only target elements that have an attribute of type ID.
Links using fragments enable authors to encode links to a SMIL presentation at the start time of a particular element rather than at the beginning of its presentation. If a link containing a fragment part is followed, the presentation should start as if the user had fast-forwarded the presentation represented by the destination document to the effective begin of the element designated by the fragment. See the discussion of linking to timing constructs in the SMIL Timing and Synchronization Module for more information.
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 Timing and Synchronization Module. In addition, the following rules apply for linking into a document written in the SMIL language:
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 SMIL Timing and 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 relaxed in future versions of SMIL.
When a link into a SMIL document contains an un-resolvable fragment identifier ("dangling link") because it identifies an element that is not actually part of the document, SMIL software should ignore the fragment identifier, and start playback from the beginning of the document.
When a link into a SMIL document contains a fragment identifier 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. If the parent is also a switch, then the link should be considered as accessing the first switch ancestor element whose parent is not also a switch. The result of the link traversal is thus to play the child of the located switch element that passes the usual switch child selection process.
The SMIL Linking module includes several attributes that a language profile can include on linking elements to add SMIL linking semantics to those elements. The SMIL Linking elements in the next section explicitly include these attributes. These attributes are designated SMIL Linking Level 0 and can be applied to linking elements from other namespaces if allowed by the language profile.
The default value of the sourcePlaystate attribute depends on the value of the show attribute. If the show attribute has the value new, the default for the sourcePlaystate attribute is play. If the show attribute has the value replace or the deprecated value pause, then the default for the sourcePlaystate attribute is pause.
Note that the definition of what constitutes a resource completing needs to be defined in the language profile, or may be implementation dependent. Typical definitions would be when the user closes the display window, or when a continuous media object ends.
The default value of show is replace.
The link elements allows the description of navigational links between objects. The SMIL Linking module provides only uni-directional, single-headed, in-line link elements. SMIL Linking Level 1 uses support from the Timing and Synchronization module and requires at least Level 0 of that module to be included with any profile using the SMIL Linking module Level 1.
The functionality of the a element is very similar to the functionality of the a element in HTML 4.01 [HTML401]. For synchronization purposes, the a element is transparent. That is, it does not influence the synchronization of its child elements. a elements may not be nested. An a element must have an href attribute.
An a element can specify several triggers for its traversal simultaneously. For example, the element's content visual media can be selected by the user or the key specified by the accesskey attribute can be typed to trigger a traversal. In cases where multiple triggers are specified, any of them can activate the link's traversal. That is, an logical or is applied to the list of triggering conditions to determine if traversal occurs.
Traversal occurs if one of the conditions for traversal is met during the time that the a element is active. An a element is active if the media or elements that it contains are active. See the SMIL Timing and Synchronization and Media modules for further details.
The a element also includes the attributes defined in SMIL Linking Level 0:
Element Content
The content of the a element must be defined by the language profile. In general, it is expected that a elements may contain the media and timing elements present in the language profile as children. Since this level of the linking module requires Level 0 from the Timing and Synchronization Module, at least the following elements should be included in the content model of the a element:
Examples
These examples assume that the a element has the same content model as in the SMIL Boston Language Profile.
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> ...
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 [HTML401] 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:
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 anchor element is deprecated in favor of area. For purposes of this specification of SMIL, the anchor element should be treated as a synonym for area
The area element can have the attributes listed below, with the same syntax and semantics as in HTML 4.0 [HTML401]:
The area element also supports the follow attributes from the SMIL Timing and Synchronization module:
The following attributes are newly added to the area element in this specification, and defined above in the section on Linking Level 0 attributes:
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.example.org/CoolStuff"> <area href="http://www.example.org/AudioVideo" coords="0%,0%,50%,50%"/> <area href="http://www.example.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.example.org/CoolStuff"> <area href="http://www.example.org/AudioVideo" begin="0s" end="5s"/> <area href="http://www.example.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. That is, 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.example.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.example.org/CoolStuff"> <area id="joe" begin="0s" end="5s" coords="0%,0%,50%,50%" href="http://www.example.org/"/> <area id="tim" begin="5s" end="10s" coords="0%,0%,50%,50%" href="http://www.www.example.org.org/Tim"/> </video>
The attributes in this section represent advanced capabilities that can be optionally included in the document profile. These features may or may not be included in a language profile, but they should not be optional features within a profile.
A profile may choose to include the fragment attribute as part of the area element. It provides for a host document to externally include a link in a contained media object that will be processed at the level of the host document.
The value of the fragment attribute must be recognizable by the process managing the media object as an activate-able portion of the object. If the referenced media object is an HTML file, then the value of the fragment attribute is a named anchor within the HTML file. If the referenced media object is an XML file, then the value of the fragment attribute is a fragment identifier (the part that comes after a '#' in a URI).
Take for example the following SMIL code. It establishes a portion of the display as a formatted text menu. Clicking on an item in this menu triggers a link to elsewhere within the presentation. The code defines embedded an HTML file and establishing a fragment area within it:
<ref src="menu.html" region="menubar"> <area fragment="menuitem1" href="#selection1"/> </ref>
In the rendered HTML display, there is a portion of displayed text that is marked-up as an area with the name "menuitem1". If the user clicks on this during the SMIL presentation, a SMIL-activated link is triggered, navigating to the portion of the SMIL document with the ID "selection1". If the HTML area named "item1" has an href attribute itself, then this hyperlink is overridden - only the SMIL hyperlink is processed. HTML area with href attributes and no associated SMIL fragment attributes are not overridden. This HTML area activate links within the embedded HTML presentation when clicked upon.
Use of the fragment attribute can override linking in the embedded media. If the attribute refers to a portion of the embedded media that is a link within that media, activating that link will trigger navigation in the SMIL presentation only, and not in the embedded presentation. For example, suppose a fragment attribute refers to a named anchor in an embedded HTML document. This named area has an href attribute, making it the starting point of a potential navigation within the HTML presentation itself. When embedded in the SMIL presentation, activation this part of the HTML display triggers the SMIL link and not the HTML link. Links in embedded media that are not overridden in this manner, on the other hand, continue to trigger navigation within the embedded display when activated. All functionality defined for the SMIL link will override any equivalent functionality defined for the link in the embedded media. With the above example, the alt attribute of the SMIL area element would override the alt tag of the embedded HTML anchor.
The referencing performed by the fragment attribute only applies to one level of depth of embedded media. It only applies to directly embedded media; it does not apply to media embedded in turn within media embedded in a SMIL presentation. For example, consider a SMIL presentation that embeds a second SMIL presentation within it. The media object element of the first that embeds the second has within it an area element with a fragment attribute. The value of this attribute applies only to the embedded SMIL document itself. It does not apply to any media embedded within this second SMIL presentation.
Example
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. That is, if user clicks on "link one", 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>
<!-- ======================================================================= --> <!-- SMIL Linking Module ================================================== --> <!-- file: SMIL-link.mod This is Smil-Boston. Copyright 2000 W3C (MIT, INRIA, Keio), All Rights Reserved. Author: Jacco van Ossenbruggen, Lloyd Rutledge, Aaron Cohen Revision: $Id: extended-linking.html,v 1.4 2000/06/22 17:41:41 hugo Exp $ This DTD module is identified by the PUBLIC and SYSTEM identifiers: PUBLIC "-//W3C//ELEMENTS SMIL-Boston Linking//EN" SYSTEM "SMIL-link.mod" ======================================================================= --> <!-- ========================== Linking Level 0 Entities =================== --> <!ENTITY % linking-attrs " sourceLevel CDATA '100%' destinationLevel CDATA '100%' sourcePlaystate (play|pause|stop) #IMPLIED destinationPlaystate (play|pause|stop) 'play' show (new|pause|replace) 'replace' accesskey CDATA #IMPLIED tabindex CDATA #IMPLIED target CDATA #IMPLIED external (true|false) 'false' actuate (onRequest|onLoad) 'onRequest' "> <!-- ======================= Linking Level 1 Elements ====================== --> <!ENTITY % link-level-1 "IGNORE"> <![%link-level-1;[ <!-- ===================== Linking Level 1 Entities ====================== --> <!ENTITY % Shape "(rect|circle|poly|default)"> <!ENTITY % Coords "CDATA"> <!-- comma separated list of lengths --> <!ENTITY % Text "CDATA"> <!ENTITY % a.attrib ""> <!ENTITY % a.content "EMPTY"> <!ENTITY % a.qname "a"> <!ELEMENT %a.qname; %a.content;> <!ATTLIST %a.qname; %a.attrib; %linking-attrs; href %URI; #IMPLIED > <!ENTITY % area.attrib ""> <!ENTITY % area.content "EMPTY"> <!ENTITY % area.qname "area"> <!ELEMENT %area.qname; %area.content;> <!ATTLIST %area.qname; %area.attrib; %linking-attrs; shape %Shape; 'rect' coords %Coords; #IMPLIED href %URI; #IMPLIED nohref (nohref) #IMPLIED alt %Text; #REQUIRED > <!ENTITY % anchor.attrib ""> <!ENTITY % anchor.content "EMPTY"> <!ENTITY % anchor.qname "anchor"> <!ELEMENT %anchor.qname; %anchor.content;> <!ATTLIST %anchor.qname; %area.attrib; %linking-attrs; shape %Shape; 'rect' coords %Coords; #IMPLIED href %URI; #IMPLIED nohref (nohref) #IMPLIED alt %Text; #REQUIRED > ]]> <!-- end of Link Level 1 --> <!-- ======================= Linking Level 2 ============================== --> <!ENTITY % link-level-2 "IGNORE"> <![%link-level-2;[ <!ENTITY % Fragment " fragment CDATA #IMPLIED "> <!-- ===================== Linking Level 2 Elements ===================== --> <!-- add fragment attribute to area, and anchor elements --> <!ATTLIST %area.qname; %Fragment; > <!ATTLIST %anchor.qname; %Fragment; > ]]> <!-- ======================= End Linking Level 2 ========================== --> <!-- end of SMIL-link.mod -->