This section is informative.
The SMIL 2.1 specification leaves the SMIL 2.0 Linking Modules[SMIL20-linking] unchanged.
This section is informative.
The SMIL 2.1 Linking Modules define the SMIL 2.1 document attributes andelements for navigational hyperlinking. These are navigations through theSMIL presentation that can be triggered by user interaction or othertriggering events, such as temporal events. SMIL 2.1 provides only forin-line link elements. Links are limited to uni-directional single-headedlinks (i.e. all links have exactly one source and one destinationresource).
The SMIL 2.1 Linking Modules are namedLinkingAttributes,BasicLinking andObjectLinking. The LinkingAttributesmodule includes a set of attributes used to provide SMIL linking semantics tolinking elements. The BasicLinking module includes the SMIL 2.1 linkingelements themselves. The ObjectLinking module includes additional optionallinking features that a language profile may wish to include. Note that theBasicLinking module explicitly includes the attributes from theLinkingAttributes module on its elements.
XPointer[XPTR] allows components of XML documents to be addressed interms of their placement in the XML structure rather than on their uniqueidentifiers. This allows referencing of any portion of an XML documentwithout having to modify that document. Without XPointer, pointing within adocument may require adding unique identifiers to it, or inserting specificelements into the document, such as a named anchor in HTML. XPointers are putwithin the fragment identifier part of a URI[URI] attribute value. TheSMIL 2.1 specification allows but does not require that user agents be ableto process XPointers in SMIL 2.1 URI attribute values.
Where possible, SMIL linking constructs have the same names as constructsfrom XLink[XLINK]. This makes it easier to learn to write linking in codein both formats: authors familiar with XLink can more quickly learn SMILlinking, and vice versa. It also makes it easier for SMIL code to beprocessed into and recognized as XLink code when the appropriate transformmechanisms become available. However, the SMIL linking attributes aredistinct from the XLink constructs and are part of a separate namespace.Using SMIL's modularization mechanism, these constructs are not in the XLinknamespace but in the namespaces defined in the SMIL 2.1 specification.
SMIL profiles may use XML Base[XMLBase]. TheSMIL 2.1 Language Profile, for example,includes support for XML Base. When XML Base is incorporated into a profile,XML Base declarations apply to the URI attribute values of SMIL used in thatprofile's documents. These attributes include the
The elements names, attributes names and attribute values of SMIL linkingconstructs are, where possible, the same as constructs in XHTML[XHTML11]with corresponding linking behavior. This facilitates learning and writing inboth languages and avoids confusion. It may also facilitate theprocessibility of both languages' linking constructs as XLink once the formatis released. The linking constructs in SMIL, however, fall under thenamespaces defined in SMIL 2.1, and not under any XHTML-related namespace.
The SMIL 2.1 Linking Modules support name fragment identifiers and the '#'connector. The fragment part is an id value that identifies one of theelements within the referenced SMIL document. With this construct, SMIL 2.1supports locators as currently used in HTML (that is, it uses locators of theform "http://www.example.org/some/path#anchor1"), with the difference thatthe 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 attributeof type ID.
Links using fragment identifiers enable authors to encode links to a SMIL2.1 presentation at the start time of a particular element rather than at thebeginning of its presentation. If a link containing a fragment part isfollowed, the presentation should start as if the user had fast-forwarded thepresentation represented by the destination document to the effective beginof the element designated by the fragment. See the discussion of linking totiming constructs in theSMIL 2.1 Timingand Synchronization Modules for more information.
There are special semantics defined for following a link containing afragment part into a document containing SMIL timing. These semantics aredefined in theSMIL 2.1 Timing andSynchronization Modules.
Due to its integrating nature, the presentation of a SMIL 2.1 document mayinvolve other (non-SMIL) applications or plug-ins. For example, a SMIL 2.1user agent may use an HTML plug-in to display an embedded HTML page. Viceversa, an HTML user agent may use a SMIL plug-in to display a SMIL 2.1document embedded in an HTML page. Note that this is only one of thesupported methods of integrating SMIL 2.1 and HTML. Another alternative is touse the merged language approach. See theSMIL 2.1 Modules for furtherdetails.
In embedded presentations, links may be defined by documents at differentlevels and conflicts may arise. In this case, the link defined by thecontaining document should take precedence over the link defined by theembedded object. Note that since this might require communication between theuser agent and the plug-in, SMIL 2.1 implementations may choose not to complywith this recommendation.
If a link is defined in an embedded SMIL 2.1 document, traversal of thelink affects only the embedded SMIL 2.1 document.
If a link is defined in a non-SMIL document which is embedded in a SMIL2.1 document, link traversal can only affect the presentation of the embeddeddocument and not the presentation of the containing SMIL 2.1 document. Thisrestriction may be relaxed in future versions of SMIL.
When a link into a SMIL 2.1 document contains an un-resolvable fragmentidentifier ("dangling link") because it identifies an element that is notactually part of the document, SMIL 2.1 software should ignore the fragmentidentifier, and start playback from the beginning of the document.
When a link into a SMIL 2.1 document contains a fragment identifier whichidentifies an element that is the content of a
The SMIL 2.1 LinkingAttribues module defines several attributes that alanguage profile can include on linking elements to add SMIL linkingsemantics to those elements. The elements in theBasicLinking Module explicitlyinclude these attributes. These attributes can be applied to linking elementsfrom other namespaces if allowed by the language profile.
The default value isplay.
The default value ofshow isreplace.
Each of the following attributes has the same syntax as the attributes ofthe same name in HTML[HTML4] and, where applicable, the same semantics:
Examples
These examples are encoded in theSMIL 2.1Language Profile.
Example 1
This examples shows the use of the
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <head> <layout> <region height="50%"/> <region top ="50%"/> </layout> </head> <body> <a href="embeddedSMIL.smil" accesskey="a"> <img region="source" src="source.jpg" dur="indefinite"/> </a> </body></smil>
Example 2
This example shows the use of the
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <seq> <video src="http://www.example.org/graph.imf"/> <par> <a tabindex="4" href="http://www.example.org/presentation"> <video src="http://www.example.org/graph.imf" ... /> </a> <video tabindex="3" src="http://www.example.org/v1.mpg" ... /> <text tabindex="1" src="http://www.example.org/caption1.html" ... /> <text tabindex="2" src="http://www.example.org/caption2.html" ... /> </par> </seq>
The link elements allows the description of navigational links betweenobjects. SMIL 2.1 linking provides only uni-directional, single-headed,in-line link elements.
The functionality of thea element isvery similar to the functionality of theaelement in HTML[HTML4]. For synchronization purposes, the
Ana element can specify severaltriggers for its traversal simultaneously. For example, the element's contentvisual media can be selected by the user or the key specified by the
Traversal occurs if one of the conditions for traversal is met during thetime that thea element is active. Ana element is sensitive if the media orelements that it contains are active or frozen. See theSMIL 2.1 Timing and SynchronizationModules for further details. For timing purposes an
Thea element also includes theattributes defined in theSMIL 2.1LinkingAttributes Module:
Element Content
The content of thea element must bedefined by the language profile. In general, it is expected that
Other Integration Requirements
Language profiles that apply SMIL 2.1 timing to the
If not otherwise specified by the profile, the value of the
Examples
These examples are encoded in theSMIL 2.1Language Profile.
Example 1
The link starts up the new presentation replacing the presentation thatwas playing.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/somewhereelse.smi"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>
Example 2
The link starts up the new presentation in addition to the presentationthat was playing.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/somewhereelse.smi" show="new"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>
This could allow a SMIL 2.1 player to spawn off an HTML user agent:
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/somewebpage.html" show="new"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>
Example 3
The link starts up the new presentation and pauses the presentation thatwas playing.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/somewhereelse.smi" show="new" sourcePlaystate="pause"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>
Example 4
The following example contains a link from an element in one presentationA to the middle of another presentation B. This would play presentation Bstarting from the effective begin of the element with id "next".
Presentation A:<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/presentationB#next"> <video src="rtsp://www.example.org/graph.imf"/> </a>Presentation B (http://www.example.org/presentation):<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <seq> <video src="rtsp://www.example.org/graph.imf"/> <par> <video src="rtsp://www.example.org/timbl.rm" region="l_window"/> <video src="rtsp://www.example.org/v1.rm" region="r_window"/> ^^^^^^^^^ <text src="rtsp://www.example.org/caption1.html" region="l_2_title"/> <text src="rtsp://www.example.org/caption2.rtx" region="r_2_title"/> </par> </seq>
The functionality of thea element isrestricted in that it only allows associating a link with a complete mediaobject. The HTMLarea element[HTML4] hasdemonstrated that it is useful to associate links with spatial portions of anobject's visual display.
The semantics of thearea element inSMIL 2.1 is the same as it is for HTML in that it can specify that a spatialportion of a visual object can be selected to trigger the appearance of thelink's destination. Thecoordsattribute specifies this spatial portion. In contrast, if an
Thearea element also extends thesyntax and semantics of the HTMLareaelement by providing for linking from non-spatial portions of the mediaobject's display. When used in profiles that includeSMIL 2.1 Timing and SynchronizationModules, thearea element allowsbreaking up an object into temporal subparts, using attributes such as thebegin and
Theanchor element ofSMIL 1.0[SMIL10] is deprecated in favor of
Thearea element can have theattributes listed below, with the same syntax as in HTML[HTML4] and, whereapplicable, the same semantics:
The following attributes of theareaelement are unique to SMIL and not found in HTML. They are defined above inthe section onLinkingAttributesmodule attributes:
Element Content
Thearea element is empty.
Examples
These examples are encoded in theSMIL 2.1Language Profile.
1) Decomposing a video into temporal segments
In the following example, the temporal structure of an interview in anewscast (camera shot on interviewer asking a question followed by shot oninterviewed person answering) is exposed by fragmentation:
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <body> <video src="video" title="Interview" > <area begin="0s" dur="20s" title="first question" /> <area begin="first0.end" dur="50s" title="first answer" /> </video> </body></smil>
2) Associating links with spatial segments In the followingexample, the screen space taken up by a video clip is split into twosections. A different link is associated with each of these sections.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <body> <video src="video" title="Interview" > <area shape="rect" coords="5,5,50,50" title="Journalist" href="http://www.example.org/journalist"/> <area shape="rect" coords="60,5,100,50" title="Subject" href="http://www.example.org/subject"/> </video> </body></smil>
3) Associating links with temporal segments
In the following example, the duration of a video clip is split into twosub-intervals. A different link is associated with each of thesesub-intervals.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <body> <video src="video" title="Interview" > <area begin="0s" dur="20s" title="first question" href="http://www.example.org/question"/> <area begin="20s" dur="50s" title="first answer" href="http://www.example.org/answer"/> </video> </body></smil>
4) Associating links with spatial subparts
In the following example, two areas are assigned in the screen space takenup by a video clip. A different link is associated with each of theseareas.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <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 twosubintervals. A different link is associated with each of thesesubintervals.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <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 presentationA to the middle of a video object contained in another presentation B. Thiswould play presentation B starting from second 5 in the video. That is, thepresentation would start as if the user had fast-forwarded the wholepresentation to the point at which the designated fragment in the "CoolStuff"video begins.
Presentation A:<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/mm/presentationB#tim"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>Presentation B:<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <video src="http://www.example.org/CoolStuff"> <area begin="0s" end="5s"/> <area begin="5s" end="10s"/> </video>
7) Combining different uses of links
The following example shows how the different uses of associated links canbe used in combination.
Presentation A:<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <a href="http://www.example.org/mm/presentationB#tim"> <video src="rtsp://www.example.org/graph.imf" region="l_window"/> </a>Presentation B:<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <video src="http://www.example.org/CoolStuff"> <area begin="0s" end="5s" coords="0%,0%,50%,50%" href="http://www.example.org/"/> <area begin="5s" end="10s" coords="0%,0%,50%,50%" href="http://www.example.org/Tim"/> </video>
8) Thecoords attribute and re-sizedimages
The following example shows the image file "example.jpg", which has thedimensions of 100x100 pixels. The active area for "example1.smil" is theentire display space, which is the cropped upper-left quarter of the originalimage. The active area for "example2.smil" cannot be triggered because theimage area corresponding to it was cropped.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <head> <layout> <region right="50" bottom="50"/> </layout> </head> <body> <img src="example.jpg" region="region"> <area shape="rect" coords="0%,0%,50%,50%" href="example1.smil"/> <area shape="rect" coords="50%,50%,100%,100%" href="example2.smil"/> </img> </body</smil>
The contents of this section represent capabilities that can be optionallyincluded in the document profile. These features may or may not be includedin a language profile, but they should not be optional features within aprofile. This module requires support of theBasicLinking Module.
A profile may choose to include the
The value of thefragment 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 thefragment attribute is a named anchor within the HTML file. If the referenced media object is an XML file, then the value of thefragment attribute is a fragment identifier (the part that comes after a '#' in a URI[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.
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> ... <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 anarea 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 HTMLarea named "menuitem1" has anhref attribute itself, then this hyperlink is overridden - only the SMIL hyperlink is processed. HTMLarea withhref attributes and no associated SMILfragment attributes are not overridden. This HTMLarea activates links within the embedded HTML presentation when clicked upon.
Use of thefragment 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 afragment attribute refers to a named anchor in an embedded HTML document. This namedarea has anhref attribute, making it the starting point of a potential navigation within the HTML presentation itself. When embedded in the SMIL presentation, activation of 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, thealt attribute of the SMILarea element would override thealt tag of the embedded HTML anchor.
The referencing performed by thefragment 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 anarea element with afragment 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.
Examples
These examples are encoded in theSMIL 2.1Language Profile.
Associating links with syntactic subparts
Below is an example with an integrated HTML file that displays a menuof
link one link two
The user can click on one of the menu items, and the matching HTML file isdisplayed. That is, if user clicks on "link one", the "Link1.html" file isdisplayed in the "LinkText" region. Note that the links defined inside theembedded HTML presentation, those to "overridden1.html" and"overridden2.html" are not active when embedded here because they areoverridden by the fragments.
The "menu.html" file contains the code:
<html>... <A NAME="link1" HREF="overridden1.html">link one</A><BR/> <A NAME="link2" HREF="overridden2.html">link two</A>
The SMIL 2.1 file is:
<smil xmlns="http://www.w3.org/2005/SMIL21/Language"> <head> <layout> <region width="100" height="100"/> <region width="100" top ="100"/> </layout> </head> <body> <par> <text region="HTML" src="menu.html" dur="indefinite"> <area fragment="link1" href="#LinkOne"/> <area fragment="link2" href="#LinkTwo"/> </text> <excl dur="indefinite" > <text region="LinkText" src="Link1.html" dur="indefinite"/> <text region="LinkText" src="Link2.html" dur="indefinite"/> </excl> </par> </body> </smil>