Movatterモバイル変換


[0]ホーム

URL:


previous  next  contents  

6.The SMIL 2.1 Linking Modules

Editor for SMIL 2.1
Thierry Michel, W3C
Editors for SMIL 2.0
Lloyd Rutledge, CWI
Aaron Cohen, Intel.

Table of contents

6.1 Summary of Changes for SMIL 2.1

This section is informative.

The SMIL 2.1 specification leaves the SMIL 2.0 Linking Modules[SMIL20-linking] unchanged.

6.2Introduction

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.

6.3Relationship with OtherXML Linking-related Formats

6.3.1Relationship withXPointer

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.

6.3.2Relationship withXLink

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.

6.3.3Relationship with XMLBase

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 thehref attribute of theSMIL BasicLinking Module and thesrc attribute of theSMIL BasicMediaModule.

6.3.4Relationship withXHTML

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.

6.4Linking into SMIL 2.1 Documents

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.

6.4.1Handling of Links in EmbeddedDocuments

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.

6.4.2Error Handling

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 aswitch element, SMIL 2.1 software shouldinterpret this link as going to the outermost ancestorswitch element instead. In other words, thelink should be considered as accessing theswitch ancestor element that is not itselfcontained within aswitch.

6.5SMIL 2.1 LinkingAttributesModule

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.

sourceLevel
This attribute sets the relative audio volume of media objects in the presentation containing the link when the link is followed. This attribute takes non-negative percentage values. The units of thesourceLevel attribute are consistent with those described for thesoundLevel attribute of the SMIL 2.1 Layout Modules, and the audio levels are modified in the same manner. The application ofsourceLevel volume control is cumulative with any media specific volume control (such as thesoundLevel attribute) on the presentation containing the link. When the display of the destination resource completes, the effect ofsourceLevelattribute on the originating presentation should be removed. The default value is '100%'.
destinationLevel
This attribute sets the relative audio volume of media objects in the remote resource when the link is followed. This attribute can take non-negative percentage values. ThedestinationLevel attribute is applied to the natural or intrinsic audio volume of the destination media, and therefore is relative to the volume that the media would be played without application of thedestinationLevel attribute. The units of thedestinationLevel attribute are consistent with those described for thesoundLevel attribute of the SMIL 2.1 Layout Modules, and the audio levels are modified in the same manner. The application ofdestinationLevel volume control is cumulative with any media specific volume control (such as thesoundLevel attribute) specified by the remote resource. The default value is '100%'.
sourcePlaystate
This attribute controls the temporal behavior of the presentation containing the link when the link is traversed. It can have the following values:
  • play: When the link is traversed, the presentation containing the link continues playing.
  • pause: When the link is traversed, the presentation containing the link pauses. When the display of the destination resource completes, the originating presentation should resume playing.
  • stop: When the link is traversed, the presentation containing the link stops. That is, it is reset to the beginning of the presentation. The termination of the destination resource will not cause the originating presentation to continue or restart.
The value of theshow attribute can determine the default value of or override the assignment of thesourcePlaystate attribute. In general, theshow attribute takes precedence over thesourcePlaystate attribute. The rules for the impact ofshow onsourcePlaystate are:
  • If theshow attribute is assigned the valuenew, then the default for thesourcePlaystate attribute isplay.
  • If theshow attribute is assigned the valuereplace or the deprecated valuepause, then the presentation behaves as if thesourcePlaystate attribute had been set topause. Any assignment of thesourcePlaystate attribute is ignored.
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.
destinationPlaystate
This attribute controls the temporal behavior of the external resource (typically identified by thehref attribute) when the link is followed. It only applies when this resource is a continuous media object. It can have the following values:
  • play: When the link is traversed, the destination of the link plays.
  • pause: When the link is traversed, the destination of the link is displayed in a paused state at the point depicted by the value of thehref attribute.

The default value isplay.

show
This attribute specifies how to handle the current state of the presentation at the time in which the link is activated. The following values are allowed:
  • new: The presentation of the destination resource starts in a new context, not affecting the source resource. If both the presentation containing the link and the remote resource contain audio media, both are played in parallel.
  • pause: This value is deprecated in favor of setting theshow attribute tonew and thesourcePlaystate attribute topause.
  • replace: The current presentation is paused at its current state and is replaced by the destination resource. If the player offers a history mechanism, the source presentation resumes from the state in which it was paused when the user returns to it. The default value of  sourcePlaystate ispause when theshow attribute has the valuereplace. If the link destination is within the same document in which this link element lies, then any assignment of this element'ssourcePlaystate attribute is ignored, and the link is processed as if the value ofsourcePlaystate wasstop. For more discussion regarding hyperlinking within the current document, see the"Hyperlinks and Timing" section of the SMIL 2.1 Timing and Synchronization Modules.

The default value ofshow isreplace.

external
This attribute defines whether the link destination should be opened by the current application or some external application. A value oftrue will open the link in an external application defined on the system to handle this media type. A value offalse will open the destination in the current application, however, if the current application does not support the media type of the referenced media, then it should attempt to render the media using an external application. Note that the means of associating media types with external applications is system dependent and not defined here. The default value of external isfalse.
Note that the above behavior for the external attribute applies to mailto links as well as media.
actuate
Theactuate attribute determines whether or not the link is triggered by some event or automatically traversed when its time span is active. Its default value isonRequest, which means something must trigger the link traversal, typically user interaction. A value ofonLoad can also be assigned. This value indicates that the link is automatically traversed when the linking element becomes active. For linking elements containing SMIL timing, this is when the active duration of the linking element effectively begins, in other words, when the element'sbeginEvent event is fired. This means that a SMIL link can be encoded to be triggered by any event that can trigger the begin of a timed element. See theSMIL 2.1 Timing and Synchronization Modules for more details.

Each of the following attributes has the same syntax as the attributes ofthe same name in HTML[HTML4] and, where applicable, the same semantics:

alt
This attribute is defined for SMIL 2.1 in theSMIL 2.1 Media Object Modules. The recommendations given there for thealt attribute on media object elements apply to its use in linking elements as well.
accesskey
This attribute assigns a keyboard key whose activation by the user in turn activates this link. It has the same meaning as the attribute of the same name in HTML[HTML4]. Keystroke-activated links in embedded presentations stay effective when embedded -- that is, if the user hits that key during the SMIL presentation, that navigation occurs within the embedded media. The rules for disambiguating links in multiple objects are:
  • Keystroke links defined in SMIL dominate over those defined in embedded media.
  • When simultaneously active SMIL linking elements have the same "accesskey", then priority goes to the one activated earliest, then to the one defined first on the SMIL code.
  • In profiles in which theSMIL 2.1 Layout Modules are used, links in media objects placed in the foremost region dominate, as defined by "stacking level" in the SMIL 2.1 Layout Modules.
  • Media objects for which no region is assigned are assumed to be more forward on the stacking level than all media objects assigned regions. This allows for the possibility of audio objects that have keystroke input, such as hyperlinked talking books for the sight-impaired.
tabindex
This attribute provides the same functionality as thetabindex attribute in HTML[HTML4]. It specifies the position of the element in the tabbing order for the current document. The tabbing order defines the order in which elements will receive focus when navigated by the user via the keyboard. At any particular point in time, only elements with an active timeline are taken into account for the tabbing order. Inactive elements should be ignored for the tabbing order.
When a media object element has atabindex attribute, then its ordered tab index is inserted in the SMIL tab index at the location specified by the media object'stabindex attribute value. This assumes the media object itself has tab indices, such as embedded HTML withtabindex attributes. This enables all link starting points in a SMIL presentation to have a place on the ordered list to be tab-keyed through, including those in embedded presentations.
target
This attribute defines either the existing display environment in which the link should be opened (e.g., a SMIL region, an HTML frame or another named window), or triggers the creation of a new display environment with the given name. Its value is the identifier of the display environment. If no currently active display environment has this identifier, a new display environment is opened and assigned the identifier of the target. When a presentation uses different types of display environments (e.g. SMIL regions and HTML frames), the namespace for identifiers is shared between these different types of display environments. For example, one cannot use atarget attribute with the value "foo" twice in a document, and have it point once to an HTML frame, and then to a SMIL region. If the element has both ashow attribute and atarget attribute, theshow attribute is ignored.

Examples

These examples are encoded in theSMIL 2.1Language Profile.

Example 1

This examples shows the use of thetarget andaccesskey attributes. The upper half ofthe display shows an image. If the user clicks on the image, a SMILpresentation is played in the lower half of the display. The same thinghappens if the user hits the 'a' key.

<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 thetabindex attribute on media objectelements. The HTML file "caption1.html" has 3 links, so the first 3 tabsfocus on those links in turn. The file caption2.html has 4 links, so tabs 4-7focus on them in turn. Tabs 8 and 9 focus the two links inside v1.mpg. Tab 10focuses on the whole presentation of graph.imf. If any of the first 9 tabbedfoci is activated, then a link inside one of the embedded presentationscaption1.html, caption2.rtx or v1.mpg is triggered, affecting only thatpresentation. If the 10th tabbed focus is activated, then the SMILpresentation itself is affected, loading http://www.example.org/presentationinto the same presentation space.

<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>

6.6SMIL 2.1 BasicLinking Module

The link elements allows the description of navigational links betweenobjects. SMIL 2.1 linking provides only uni-directional, single-headed,in-line link elements.

6.6.1Thea Element

The functionality of thea element isvery similar to the functionality of theaelement in HTML[HTML4]. For synchronization purposes, thea element is transparent. That is, it does notinfluence the synchronization of its child elements.a elements may not be nested. Ana element must have anhref attribute.

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 theaccesskey attribute can be typed totrigger a traversal. In cases where multiple triggers are specified, any ofthem can activate the link's traversal. That is, a logical OR is applied tothe list of triggering conditions to determine if traversal occurs.

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 ana element is considered to be discrete media,that is, the intrinsic duration is 0. Note that ana element is not a time container and does notconstrain the timing of its child elements.

Attributes
href
This attribute has the same syntax and semantics as thehref attribute of HTML[HTML4]. It contains the URI of the link's destination. Thehref attribute is required fora elements.

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 thata elements may contain the media and timingelements present in the language profile as children.

Other Integration Requirements

Language profiles that apply SMIL 2.1 timing to thea element must specify the default and allowedvalues of thefill attribute on thea element. Languages applying SMIL 2.1timing to thea element wishing to remaincompatible with SMIL 1.0, such as the SMIL 2.1 language profile, must defaultthe value of thefill attribute on thea element toauto, and should consider fixing the value toauto. In all other cases, for compatibility, it isrecommended to use a default value ofauto

If not otherwise specified by the profile, the value of thefill attribute on thea element is fixed toauto.

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>

6.6.2Thearea Element

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 ana element is applied to a visual object, then itspecifies that any visual portion of that object can be selected to triggerthe link traversal.

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 andend attributes. The values of thebegin andend attributes are relative to the beginningof the containing media object. Thearea element can allow to make a subpart ofthe media object the destination of a link, using these timing attributes andtheid attribute.

Theanchor element ofSMIL 1.0[SMIL10] is deprecated in favor ofarea. For purposes of this specification ofSMIL 2.1, theanchor element shouldbe treated as a synonym forarea

Attributes

Thearea element can have theattributes listed below, with the same syntax as in HTML[HTML4] and, whereapplicable, the same semantics:

href
Defined in theBasicLinking module.
alt
Defined in theLinkingAttributes module.
tabindex
Defined in theLinkingAttributes module.
accesskey
Defined in theLinkingAttributes module.
target
Defined in theLinkingAttributes module.
nohref
When set, this attribute specifies that the region has no associated link, even if other area elements for the media object define links for it. It uses the same syntax as for thenohref attribute in HTML 4.01.

shape
This attribute specifies the shape of an anchor on the screen, and is used with thecoords attribute. Theshape attribute of SMIL has the same behavior as in HTML[HTML4]. The object that theshape attribute is applied to is the media of the containing element after the media has been scaled for presentation but before it has been clipped.
coords
Along with theshape attribute, this attribute specifies the position and shape of the anchor on the screen. The number and order of values depends on the shape being defined. Where SMIL and HTML share visual display behavior, thecoords attribute of SMIL has the same behavior as in HTML[HTML4]. How thecoords attribute of SMIL applies to SMIL visual display behavior is as follows:
  1. The upper-left corner origin used by thecoords attribute is in the image display space, not the region it is displayed in. One example of when the image and region upper-left corner differ is whenleft andtop attributes are used in the media object elements and applied to the region.
  2. As in HTML, pixel values of thecoords attribute refer to the pixels of the display space - that is, typically, of the user's screen. These can differ from the pixel values of the source image. One example of when they can differ in SMIL is when thefit attribute of theregion element used is not "hidden".
  3. In SMIL, it is possible for a portion of the image to be not visible. For example, this can happen when thefit attribute of theregion element is hidden, and the image is bigger in pixels than the region. In such cases, the rules for placing active areas on the image apply to the screen space the image would take if no cropping occurred. This is particular important to note for percentage values: these do not apply to the cropped image but to the space the image would occupy if it weren't cropped. Areas that, with this rule, are placed beyond display boundaries are not active.
If multiplearea element children of the same media object element define simultaneously active overlapping areas with theircoords attributes, then, as in HTML[HTML4], thearea element that is encoded earliest in the document takes precedence.

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>

6.7SMIL 2.1 ObjectLinking Module

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.

6.7.1 ThefragmentAttribute

A profile may choose to include thefragment attribute as part of thearea element. It provides for a host documentto externally include a link in a contained media object that will beprocessed at the level of the host document.

fragment
This attribute refers to a portion of the embedded media object that is to act as the starting point of this link in the SMIL presentation. If the user clicks on, or otherwise activates, this portion of the embedded media display, the SMIL user agent recognizes this as the current link being activated. This overrides any linking that may happen within the embedded display of the media object.

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>

previous  next  contents  

[8]ページ先頭

©2009-2025 Movatter.jp