W3C Working Draft 2-February-98
This document is a W3C Working Draft produced by the W3C Working Group on Synchronized Multimedia (SYMM). It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C technical reports can be found at http://www.w3.org/TR.
This document is updated very frequently, and major changes are expected within the next months. Thus, this is a draft document which may be updated, replaced or obsoleted by other documents at any time. Please check back regularly to get the latest version of the draft. You are encouraged to implement a prototype based on this draft, but you should realize that you may have to change your implementation when the draft changes.
A review of this draft by the Web Accessibility Initiative is still pending.
This document specifies the Synchronized Multimedia Integration Language (SMIL, pronounced "smile"). SMIL allows integrating a set of independent multimedia objects into a synchronized multimedia presentation. Using SMIL, presentations such as a slide show synchronized with audio comments or a video synchronized with a text stream can be described.
A typical SMIL presentation has the following characteristics:
SMIL has been designed so that it is easy to author simple presentations with a text editor. The key to success for HTML was that attractive hypertext content could be created without requiring a sophisticated authoring tool. SMIL achieves the same for synchronized hypermedia.
To get a quick idea on how to use SMIL, study the example in section 7.4.
Specification Approach
SMIL documents are XML documents as defined by the XML 1.0 specification.
For describing the syntax of SMIL documents, this specification uses two notations:
The BNF is included since it is easier to read for a large part of the intended audience of this specification. However, reflecting XML syntax in the BNF leads to a number of unusual constructs:
A = "A" "=" (<">A-value<"> | "'"A-value"'")
E = "<E" *att-list ("/>" | "></E" ">")
If E is not always empty:
E = "<E" *att-list (">" content "</E" ">" |
"/>")
Within all attribute values, the "<" and the "&" character must be escaped. When the "'" character is used as a delimiter for the attribute value, it must be escaped when it occurs within the attribute value. Likewise, the double-quote character must be escaped when used as a delimiter. These characters can be escaped using either the appropriate XML predefined entity (http://www.w3.org/TR/PR-xml#sec-predefined-ent), or the appropriate XML character reference (http://www.w3.org/TR/PR-xml#sec-references).
Note that other characters contained e.g. in attribute values or comments can also be represented by XML character references. See the XML specification for exact information on where XML predefined entities and XML character references are allowed.
If a SMIL implementation uses a parser implemented directly from the BNF, an additional check must be added to verify that each attribute occurs only once within a particular element. The BNF given in this specification does not reflect this requirement.
Except for the considerations above, any difference between the BNF and the DTD specification is an error in this specification. In this case, the DTD specification takes precedence over the BNF specification.
Syntax
smil-doc = xml-prolog smil *xml-Misc xml-Prolog = [xml-decl] *xml-Misc [xml-doctypdecl] xml-decl = "<?xml" xml-VersionInfo [xml-EncodingDecl] [xml-SDDecl] "?>" xml-VersionInfo = "version" "=" (<"> "1.0" <"> | "'" "1.0" "'") xml-EncodingDecl = (any legal XML encoding declaration - see http://www.w3.org/TR/PR-xml#charencoding) xml-SDDecl = "standalone" "=" (<"> "no" <"> | "'" "no" "'") ; value is "no", since validating XML procesors must ; know the SMIL 1.0 DTD, e.g because it uses default values xml-Misc = xml-Comment | xml-PI xml-Comment = "<!--" *TEXT "-->" ; the string "--" must not occur within comments xml-PI = (any legal XML processing instruction - see http://www.w3.org/TR/PR-xml#sec-pi) xml-doctypedecl = "<!DOCTYPE" "smil" "SYSTEM" (<">DTD-URI<"> | "'"DTD-URI"'") ">" DTD-URI = "http://dejavu.cs.vu.nl/~symm/validator/SMIL10.dtd"
Semantics
A SMIL 1.0 document may optionally contain a document type declaration, which names the document type definition (DTD) in use for the document. For SMIL, the document type declaration should look as follows (alternatively, single quotes can be used to mark begin and end of the URI):
<!DOCTYPE smil SYSTEM
"http://dejavu.cs.vu.nl/~symm/validator/SMIL10.dtd">
@@ Editor's note: of course, the above URI will change to a URI stored at W3C at a later point.
Some SMIL implementations may use the DTD to check whether the document is "valid" in the XML sense. The URI in the document type declaration allows user agents to download the DTD. The following URI refers to the DTD for SMIL 1.0 that W3C supports:
The XML 1.0 specification provides a way to extend the DTD using the <!DOCTYPE> element, for instance to add a new set of entity definitions. Authors must not use this feature with SMIL since many SMIL players will not support it.
ILLEGAL EXAMPLE:
The following is illegal in SMIL:
<!DOCTYPE smil SYSTEM
"http://dejavu.cs.vu.nl/~symm/validator/SMIL10.dtd" [
<!ENTITY % AcmeCorpSymbols SYSTEM
"-//Acme Corp//ENTITIES Corporate Symbols//EN">
%AcmeCorpSymbols;
]>
Syntax
smil = "<smil" *smil-attribute (">" *xml-Misc [head] *xml-Misc [body] *xml-Misc "</smil" ">" | "/>") smil-attribute = id id = "id" "=" (<">id-value<"> | "'"id-value"'") id-value = (any legal XML name symbol) ; must be unique within document head = "<head" *head-attribute (">" *head-element "</head" ">" | "/>") head-attribute = id head-element = layout-section | meta | xml-Misc body = "<body" *body-attribute (">" *xml-Misc [body-content] *xml-Misc "</body" ">" | "/>") body-attribute = id body-content = schedule | switch | link
General Semantics
A SMIL document may contain a head part and a body part. Either part may contain XML comments and XML processing instructions.
Attributes
Syntax
layout-section = layout | "<switch" *switch-attribute (">" *layout "</switch" ">" | "/>") layout = "<layout" *layout-attribute (">" *layout-content "</layout" ">" | "/>") layout-attribute = id | layout-type layout-type = "type" "=" (<">layout-language<"> | "'"layout-language"'") layout-language = "text/smil-basic" | other-layout-language other-layout-language= *TEXT layout-content = basic-layout | other-layout basic-layout = channel | xml-Misc other-layout = *TEXT | (a legal XML CDATA section) ; characters must be escaped appropriately if the layout ; language is not XML based, and is not included ; in a CDATA section
General Semantics
An SMIL document may contain of a layout section that determines the placement presentation components in non-temporal dimensions. If the layout section is missing, the placement of elements is implementation dependent. The layout section may contain several alternative layout elements embedded within a switch element. The player chooses one of these alternatives. This can be used for example to describe the document layout using different layout languages. This specification defines a basic layout language for SMIL (see Appendix 7.1).
Attributes
Syntax
meta = "<meta" *meta-attribute ("/>" | "></meta" ">") meta-attribute = name | content meta-name = "name" "=" (<">meta-name-value<"> | "'"meta-name-value"'") meta-name-value = "sync" | "title" | "pics-label" | "PICS-Label" | *TEXT meta-content = "content" "=" (<">meta-content-value<">|"'"meta-content-value"'") meta-content-value = sync-value | *TEXT | pics-value ; whether a content-value is legal depends on the ; exact name-value. See "general semantics" for ; definitions ; the values for the pics-label attribute are defined ; in the W3C PICS recommendation sync-value = "hard" | "soft"
General Semantics
The META element can be used to identify properties of a document (e.g., author, expiration date, a list of key words, etc.) and assign values to those properties. Each META element specifies a property/value pair. The name attribute identifies the property and the content attribute specifies the property's value. The list of properties is open-ended. This specification defines three properties:
Attributes
Syntax
schedule = parallel | sequential | media-object
General Semantics
Schedule elements specify the temporal behavior in a SMIL document. They can be composite (parallel, sequential) or atomic (media-object).
Schedule elements have a begin and an end time. Begin and end time of an element E can be determined in one of two ways: either they are derived from the composite element which contains E, or they are determined by synchronization attributes contained within the start tag of E.
The player keeps track of a presentation clock that advances at the speed of the presentation and measures presentation time.
Syntax
parallel = "<par" *par-attribute (">" *par-content "</par" ">" | "/>") par-content = schedule | switch | link | xml-Misc par-attribute = id | endsync | sync | dur | repeat | fill | channel | *sync-attribute | *switch-param-attribute endsync = "endsync" "=" (<">endsync-value<"> | <'>endsync-value<'>) endsync-value = "first" | "last" | id-ref id-ref = "id(" id-value ")" sync = "sync" "=" sync-value dur = "dur" "=" (<">clock-val<"> | <'>clock-val<'>) clock-val = full-clock-val | partial-clock-val | timecount-val full-clock-val = hours ":" minutes ":" seconds ["." units] partial-clock-val = minutes ":" seconds ["." units] timecount-val = timecount ["." fraction] ["h" | "min" | "s" | "ms" ] ; default is "s" hours = 2DIGIT ; any positive number minutes = 2DIGIT ; range from 00 to 59 seconds = 2DIGIT ; range from 00 to 59 units = 1*DIGIT timecount = 1*DIGIT fraction = 1*DIGIT repeat = "repeat" "=" (<">*DIGIT<"> | <'>*DIGIT<'>) fill = "fill" "=" (<">fill-value<"> | <'>fill-value<'>) fill-value = "remove" | "freeze" | "loop"
General Semantics
End Time
By default, the end time of a parallel element is equal to the maximum end time of all children in the parallel element. If none of the children has a known end time, the end time and the duration of the parallel element are also unknown. In this case, the parallel element is terminated by an external event, for example when the user hits a "stop" button.
The default end time of a parallel element can be overridden by using the "endsync", the "dur" or the "end" attribute (see below).
Begin/End Time of Children
If the begin time of a child in a parallel element is unknown, it is set to the begin time of the parallel element. If the end time of a child in a parallel element is unknown, it is set to the end time of the parallel element.
Channel attribute
The channel attribute on parallel elements cannot be used by the basic layout language for SMIL defined in this specification. It is added for completeness, since it may be required by other layout languages.
Attributes
audio |----....------| video |----....------| audio |----------| video |----....--|
a) sync = "hard": Delay in video: Either the audio is stopped, or some video frames are dropped. The exact behavior is implementation-dependent
audio |----------| video |----....------|
b) sync = "soft"
Figure 6.1: Effect of a delay on playout schedule for different settings of the sync attribute
<par endsync="last"> <audio .../> <video .../> <img .../> </par> audio |---------------| | | video | |--------| | | | image \ / |---------------|
a) endsync="last" (default behavior)
<par endsync="first"> <audio .../> <video .../> <img .../> </par> audio |---------......| / \ | video | |--------| | | image \ / |--------|
b) endsync="first"
Figure 6.2: Effect of endsync attribute
The attribute can have the following values:
<seq> <img dur="0s" fill="freeze" .../> <audio id="a" .../> </seq> audio |-------| |-----|-----|-----|-----> Presentation clock (in s)
a) Audio ready on time
img audio |---------|-------| |-----|-----|-----|-----> Presentation clock (in s) | | | Audio ready
b) Delay in audio start
Syntax
sequential = "<seq" *seq-attribute (">" *seq-content "</seq" ">" | "/>") seq-content = schedule | switch | link | xml-Misc seq-attribute = id | dur | repeat | fill | sync-attribute | switch-param-attribute
General Semantics
Begin and end time of a child in a seq element have the following default values:
The default value for the end time of a seq element is the end time of the last element contained in the sequence.
The channel attribute on sequential elements cannot be used by the basic layout language for SMIL defined in this specification. It is added for completeness, since it may be used by other layout languages.
Syntax
media-object = ref |audio | img | video | text ref = "<ref" *cmo-attribute ("/>" | ">" *mo-content "</ref" ">") audio = "<audio" *cmo-attribute ("/>" | "></audio" ">") img = "<img" *mo-attribute ("/>" | ">" *mo-content "</img" ">") video = "<video" *cmo-attribute [range] ("/>" | ">" *mo-content "</video" ">") text = "<text" *mo-attribute ("/>" | ">" *mo-content "</text" ">") cmo-attribute = range | mo-attribute ; "cmo" stands for "continuous media object" mo-attribute = id | src | type | channel | dur | repeat | fill | sync-attribute | switch-param-attribute | mo-xml-link-def | mo-show-def | mo-actuate-def | mo-inline-def src = "src" "=" (<">URL<"> | <'>URL<'>) ; URL syntax defined in RFC 1808 type = "type" "=" (<">MIME-type<"> | "'"MIME-type"'") ; MIME-type syntax defined in RFC 2045 channel = "channel" "=" (<">id-value<"> | "'"id-value"'") range = "range" "=" (<">range-value<"> | "'"range-value"'") range-value = range-specifier ":" ( npt-range | smpte-range ) range-specifier = smpte-type | "npt" smpte-type = "smpte" | "smpte-30-drop" | "smpte-25" smpte-range = ( smpte-time "-" [ smpte-time ] ) | ( "-" smpte-time ) smpte-time = 2DIGIT ":" 2DIGIT ":" 2DIGIT [ "." 2DIGIT ] npt-range = ( clock-val "-" [ clock-val ] ) | ( "-" clock-val ) ; the following rules are added to handle normalized XML documents containing ; the default values for these attributes mo-xml-link-def = "xml-link" "=" (<">"simple"<"> | "'""simple""'") mo-show-def = "show" "=" (<">"embed"<"> | "'""embed""'") mo-actuate-def = "actuate" "=" (<">"auto"<"> | "'""auto""'") mo-inline-def = "inline" "=" (<">"true"<"> | "'""true""'") mo-content = anchor | xml-Misc
General Semantics
The media object elements allow the inclusion of external components into an SMIL presentation.
The names "audio", "video", "text" and "img" are synonyms for "ref". They serve to improve the readability of the document. The player must not derive the type of the media object from the name of the media object element. This is important when the URL points to the description of a media object file rather than to the object itself.
Editor's note: The semantics of the "audio", "video", "text" and "img" elements may change in a later version of the document, if it is decided that media type specific attributes should be added to these elements, for example specific attributes that only apply in audio files.
Anchors and links can be attached to visual media objects (such as media objects typically included via the "video", "text" and "img" elements). This is achieved by putting the appropriate "anchor" elements between the start tag and the end tag of the media object.
Attributes
range="smpte:10:12:33:20-"
range="smpte:10:07:33-"
range="smpte:10:07:00-10:07:33:05.01"
range="smpte:10:07:00-10:07:33:05.01
"
range="npt:123.45s-125s"
range="npt:12:05:35.3
-"
Syntax
sync-attribute = begin | end begin = "begin" "=" event-val end = "end" "=" event-val event-val = <">event-spec<"> | "'"event-spec"'" event-spec = element-event | offset element-event = "id(" event-source ")(" event ")" ["+" delay] event-source = id-value event = clock-val | "begin" | "end" delay = clock-val offset = clock-val
General Semantics
The synchronization attributes "begin" and "end" can be added to any schedule element. These attributes change the default begin and end times of the element. A synchronization attribute can be an offset value or a qualified event.
If the value of a synchronization attribute is an offset value, its semantics depends on the parent of the element containing the synchronization attribute:
<par> <audio id="a" begin="6s" ... /> ... </par>
par |------------------| 6s a <----->|-----------|
Figure 6.4: Synchronization attribute with offset value within a parallel group
<seq> <audio .../> <audio begin="5s" .../> </seq> audio 5s audio |---------|<---->|---------|
Figure 6.5: Synchronization attribute with offset value within a sequential group
If the value of a synchronization attribute is an element event, the attribute specifies that an element should begin or end when a particular event occurs in another element (see Figure 6.6). This element must be a sibling of the element with the synchronization attribute.
The following events are defined for all schedule elements:
begin="id(x)(begin)"
begin="id(x)(end)"
Example use: begin="id(x)(45s)"
<par> <audio id="a" begin="6s" ... /> <img begin="id(a)(4s)" ... /> </par>
par |-----------------| 6s a <---->|-----------| 4s <--> img |-------|
Figure 6.6: Synchronization attribute with qualified event value
Error Handling
Attributes
Syntax
switch = "<switch" *switch-attribute (">" *switch-content "</switch>" | "/>") switch-content = xml-Misc | schedule | switch | link switch-attribute = id
General Semantics
The switch element allows an author to specify a set of alternative elements from which only one element should be chosen.
The switch element can be used, for example, to express that the audio track of a video is available in different languages. More generally, the elements within a switch differ with respect to one or more parameter values (e.g. language, bitrate).
The player can obtain these parameter values in two ways:
It may be possible to discover a particular parameter values using both methods. It depends on the particular parameter which value takes precedence if the parameter value contained in the SMIL file differs from the value retrieved over the network differ.
This specification defines a list of parameters and values that can be used by a switch. The parameter list is open-ended, and implementations are free to add new attributes to this list.
The exact selection process of the list of elements is implementation specific. However, the recommended method of implementation is to evaluate the topmost element for acceptability, and if that element has acceptable properties, to select that element at the exclusion of other elements within the switch. Only if the first element does not have acceptable properties, the media player would move down the list of alternatives. Thus, authors should order the alternatives from the most desirable to the least desirable.
Syntax
switch-param-attribute = bitrate | language | screen-size | screen-depth | new-attribute bitrate = "bitrate" "=" (<">*DIGIT<"> | "'"*DIGIT"'") language = "language" "=" (<">language-value<"> | "'"language-value"'") ; the values for the language attribute are defined ; in RFC 1766 screen-size = "screen-size" "=" (<">screen-size-val<"> | "'"screen-size-val"'") screen-size-val = screen-height"X"screen-width screen-height = *DIGIT screen-width = *DIGIT screen-depth = "screen-depth" "=" (<">screen-depth-val<"> | "'"screen-depth-val"'") screen-depth-val = *DIGIT new-attribute = attribute-name "=" (<">attribute-value<"> | "'"attribute-value"'") ; attribute-name is an XML name, ; attribute-values must conform to XML syntax
Attributes
Examples
1) Choosing between content with different bitrate
In a common scenario, implementations may wish to allow for selection via a "bitrate" parameter on elements. The media player evaluates each of the "choices" (elements within the switch) one at a time, looking for an acceptable bitrate given the known characteristics of the link between the media player and media server.
... <par> <text .../> <switch> <par bitrate="40000"> ... </par> <par bitrate="24000"> ... </par> <par bitrate="10000"> ........ </par> </switch> </par> ...
2) Choosing between audio resources with different bitrate
The elements within the switch may be any combination of elements. For instance, one could merely be specifying an alternate audio track:
... <switch> <audio src="joe-audio-better-quality" bitrate="16000" /> <audio src="joe-audio" bitrate="8000" /> </switch> ...
3) Choosing between audio resources in different languages
In the following example, an audio resource is available both in French and in English. Based on the user's preferred language, the player can choose one of these audio resources.
... <switch> <audio src="joe-audio-better-quality" language="fr"/> <audio src="joe-audio" language="en"/> </switch> ...
4) Choosing between content written for different screens
In the following example, the presentation contains alternative parts designed for screens with different resolutions and bit-depths. Depending on the particular characteristics of the screen, the player can choose one of the alternatives.
... <par> <text .../> <switch> <par screen-size="640X480" screen-depth="16"> ... </par> <par screen-size="640X480" screen-depth="32"> ... </par> <par screen-size="1280X1024" screen-depth="16"> ........ </par> </switch> </par> ...
Relation to XML linking
The link element allows the description of navigational links between objects. SMIL linking is based upon the linking concepts described in the XML Linking draft (XLL).
This specification uses the terms resource, linking element, locator and in-line link as defined in XLL. SMIL provides only for in-line link elements. Out-of-line links in the sense of XLL may be added in a future version. Links are limited to uni-directional single-headed links (i.e. all links have exactly one source and one destination resource). All links in SMIL are actuated by the user (i.e. all links have an implicit attribute actuate="user").
Handling of Links in Embedded Documents
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.
In such 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.
Addressing
SMIL uses the locator syntax defined in XLL. Support for the name fragment identifier and the '#' connector is required, support for XPointers and the "|" connector is optional. In practice, this means that SMIL only requires support for locators as currently used in HTML (e.g. it uses locators of the form "http://foo.com/some/path#anchor1").
Linking to SMIL Fragments
A locator that points to an SMIL document may contain a fragment part (e.g. http://www.w3.org/test.smi#par1). The fragment part is an id attribute that identifies one of the elements within the referenced SMIL document. If a link containing a fragment part is followed, the presentation should start as if the user had fast-forwarded to the beginning of the designated fragment in the destination document.
Syntax
link = "<a" *link-attribute (">" *src-element "</a" ">" | "/>") link-attribute = id | src | show | inline-xml-link-def | inline-inline-def src-element = xml-Misc | schedule | switch ; link element not in this list, ; since links cannot be nested show = "show" "=" (<">show-value<"> | "'"show-value"'") show-value = "replace" | "new" | "pause" ; the following rules are added to handle normalized XML documents containing ; the default values for these attributes inline-xml-link-def = "xml-link" "=" (<">"simple"<"> | "'""simple""'") inline-inline-def = "inline" "=" (<">"true"<"> | "'""true""'")
General Semantics
The functionality of the "a" element is largely identical to the functionality of the "a" element in HTML 4.0. SMIL adds an attribute "show" that controls the temporal behavior of the source when the link is followed. "a" elements may not be nested. The "a" element must have an href attribute. An "a" element has implicit attributes xml-link="simple" and inline="true".
Attributes
Support for the EMBED value as defined by XLL is not required.
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" channel="l_window"/> </a>
The first line defines the destination of the link. The second line is the next video item in the SMIL presentation (inline). The third line is the end of the link.
In the example, the second line can be replaced by a reference to any valid subtree of an SMIL presentation.
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" channel="l_window"/> </a>
For example, this allows a SMIL player to spawn off an HTML browser.
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="pause"> <video src="rtsp://foo.com/graph.imf" channel="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 point where the designated fragment begins (i.e. the presentation would start as if the user had fast-forwarded to the beginning of the designated fragment in the destination document).
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" channel="l_window"/> <video id="next" src="rtsp://foo.com/v1.rm" channel="r_window"/> ^^^^^^^^^ <text src="rtsp://foo.com/caption1.html" channel="l_2_title"/> <text src="rtsp://foo.com/caption2.rtx" channel="r_2_title"/> </par> </seq> ...
Syntax
anchor = "<anchor" *anchor-attribute ("/>" | "></anchor>") anchor-attribute = link-attribute | coords | z-index | sync-attribute | iid coords = "coords" "=" (<"> left-x "," top-y "," right-x "," bottom-y <">) | ("'" left-x "," top-y "," right-x "," bottom-y "'") left-x = length top-y = length right-x = length bottom-y = length length = *DIGIT[%] z-index = "z-index" "=" (<">z-value<"> | <'>z-value<'>) z-value = *DIGIT iid = "iid" "=" (<">*TEXT<"> | "'"*TEXT"'")
General Semantics
The functionality of the "a" element is restricted in that it only allows associating a link with a complete media object. HTML image maps have demonstrated that it is useful to associate links with spatial subparts of an object. The anchor element realizes similar functionality for SMIL:
An anchor element has implicit attributes xml-link="simple" and inline="true".
Attributes
Media Object Display Area | 0,0 \ / +-----------------------------------+ | / \ / \ | | | | | | | top-y | | | | | | | \ / | bottom-y | |left-x|-------------| | | |<---->| | | | | | | | | | | | | | | |-------------| \ / | | | | right-x | |<-------------------> | | | | | | | +-----------------------------------+
Figure 6.7: Semantics of "coords" attribute
Attribute Values
Examples
1) Associating links with spatial subparts
In the following example, the screenspace taken up by a video clip is split into two regions. A different link is associated with each of these regions.
<video src="http://www.w3.org/CoolStuff"> <anchor href="http://www.w3.org/AudioVideo" coords="0%,0%,50%,50%"/> <anchor href="http://www.w3.org/Style" coords="50%,50%,100%,100%"/> </video>
2) 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"> <anchor href="http://www.w3.org/AudioVideo" begin="0s" end="5s"/> <anchor href="http://www.w3.org/Style" begin="5s" end="10s"/> </video>
3) Jumping to a subpart of an object
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 point where the designated fragment begins (i.e. the presentation would start as if the user had fast-forwarded to the beginning of the designated fragment in the "CoolStuff" video).
Presentation A: <a href="http://www.cwi.nl/mm/presentationB#tim"> <video id="graph" src="rtsp://foo.com/graph.imf" channel="l_window"/> </a> Presentation B: <video src="http://www.w3.org/CoolStuff"> <anchor id="joe" begin="0s" end="5s"/> <anchor id="tim" begin="5s" end="10s"/> </video>
4) Associating links with media-format internal identifiers
In the following example, two internal identifiers contained in the "CoolStuff" animation file are made accessible within SMIL. A link is associated with the objects designated by these identifiers.
<ref src="http://www.w3.org/CoolStuff.anim"> <anchor id="joe" iid="AX789" href="http://www.cnn.com/joe"/> <anchor id="tim" iid="AY994" href="http://www.w3.org/People/Berners-Lee"/> </ref>
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" channel="l_window"/> </a> Presentation B: <video src="http://www.w3.org/CoolStuff"> <anchor id="joe" begin="0s" end="5s" coords="0%,0%,50%,50%" href="http://www.w3.org/"/> <anchor id="tim" begin="5s" end="10s" coords="0%,0%,50%,50%" href="http://www.w3.org/Tim"/> </video>
This is a normative appendix of this specification
The channel Element
Syntax
channel = "<channel" *channel-attribute ("/>" | "></channel" ">") channel-attribute = id | left | top | z-index | width | height | scale left = "left" "=" (<">length<"> | <'>length<'>) top = "top" "=" (<">length<"> | <'>length<'>) width = "width" "=" (<">length<"> | <'>length<'>) height = "height" "=" (<">length<"> | <'>length<'>) scale = "scale" "=" (<">scale-value<"> | <'>scale-value<'>) scale-value = "meet" | "slice" | "fill" | "visible" | "hidden" | "auto" | "scroll"
General Semantics
The channel element controls the position, size and scaling of a visual media object (for example text, image, video) within a rendering window. If a media object overlaps with the borders of the rendering window, the parts that are outside of the rendering window are clipped.
The channel element and its attributes define the SMIL basic layout language. The type identifier for this language is "text/smil-basic" (note that this is not a registered MIME type, and probably will not become one in future. A MIME-like notation is chosen to be consistent with the type-specification for other layout languages).
All channel elements must have an id attribute. Media objects that use a particular channel element reference its id in their channel attribute.
In order to select the default layout values for all elements in a document, the document must contain an empty layout section, for example:
"<layout type="text/smil-basic"></layout>"
CSS is one of the alternative layout languages that can be supported by SMIL implementations.
The working group has seriously studied the alternative of using CSS positioning directly for laying SMIL media objects, instead of introducing SMIL basic layout. This was preliminarily rejected for several reasons:
These issues require further study, and it was felt that a detailed evaluation of the suitability of CSS at this point would delay the core functionality of SMIL, namely its synchronization features. However, the issue is still under consideration, and the decision for "smil-basic" is not final, as any other decision reflected within this document.
Differences between SMIL basic layout and CSS positioning include:
SMIL basic layout is identical to CSS positioning in the following points:
Attributes
Rendering Window | 0,0 \ / +-----------------------------------+ / \ | / \ | | | | | | | | top | | | | | | | \ / | | | left |-------------| / \ | | Rendering Height |<---->| | | | | | | | | height | | | | | | | | | |-------------| \ / | | | | | | <-------------> | | | width | | +-----------------------------------+ \ / <-----------------------------------> Rendering Width
Figure 7.1: Semantics of left, top, width and height attributes
This is an informative part of this specification
All of the mechanisms specified in this document are described in both prose and an augmented Backus-Naur Form (BNF) similar to that used by RFC 2068 (http 1.1) and RFC 822. Implementers will need to be familiar with the notation in order to understand this specification. The augmented BNF includes the following constructs:
Basic Rules
The following rules are used throughout this specification to describe basic parsing constructs:
DIGIT = (any legal XML digit) <"> = <double-quote mark Unicode character (34))> LWS = (legal XML White Space) TEXT = (any legal XML character) token = 1*<any legal XML character except tspecials> tspecials = "(" | ")" | "<" | ">" | "[" | "]" | "?" | "=" | SP | HT
The XML 1.0 specification allows encoding any XML character in either UTF-8 or UTF-16. Characters can also be represented using a XML character reference. Moreover, the following characters can be represented by their respective XML predefined entity: "<", ">", "&", "'" and """.
This is a normative appendix of this specification
<!-- This is a draft and experimental XML document type definition for SMIL 1.0. Draft: $Date: 1998/05/22 19:33:00 $ ($Revision: 1.2 $) Author: Jacco van Ossenbruggen <jrvosse@cwi.nl> This is work in progress, subject to change at any time. Further information about SMIL 1.0 is available at: http://www.w3.org/AudioVideo/ --> <!--=================== SMIL Document =====================================--> <!-- The root element SMIL contains all other elements. --> <!ELEMENT smil (head?,body?)> <!ATTLIST smil id ID #IMPLIED > <!--=================== The Document Head =================================--> <!ENTITY % layout-section "layout|switch"> <!ENTITY % head-element "%layout-section;|meta"> <!ELEMENT head ((%head-element;)*)> <!ATTLIST head id ID #IMPLIED> <!--=================== Layout Element ====================================--> <!-- Layout contains channel elements or the elements of an external layout mechanism. --> <!ELEMENT layout ANY> <!ATTLIST layout id ID #IMPLIED type CDATA "text/smil-basic" > <!--=================== Channel Element ===================================--> <!ELEMENT channel EMPTY> <!ATTLIST channel id ID #REQUIRED left CDATA "0" top CDATA "0" z-index CDATA "0" height CDATA #IMPLIED width CDATA #IMPLIED scale (meet|slice|fill|visible|hidden|auto|scroll) "meet" > <!--=================== Meta Element=======================================--> <!ELEMENT meta EMPTY> <!ATTLIST meta name NMTOKEN #REQUIRED content CDATA #REQUIRED > <!--=================== The Document Body =================================--> <!ENTITY % media-object "audio|video|text|img|ref"> <!ENTITY % schedule "par|seq|(%media-object;)"> <!ENTITY % inline-link "a"> <!ENTITY % assoc-link "anchor"> <!ENTITY % link "%inline-link;"> <!ENTITY % container-content "(%schedule;)|switch|(%link;)"> <!ENTITY % body-content "%container-content;"> <!ELEMENT body (%body-content;)?> <!ATTLIST body id ID #IMPLIED> <!--=================== Synchronization Attributes ========================--> <!ENTITY % sync-attributes " begin CDATA #IMPLIED end CDATA #IMPLIED "> <!--=================== Switch Parameter Attributes =======================--> <!ENTITY % switch-param-attribute " bitrate CDATA #IMPLIED language CDATA #IMPLIED screen-size CDATA #IMPLIED screen-depth CDATA #IMPLIED "> <!--=================== Fill Attribute ====================================--> <!ENTITY % fill-attribute " fill (remove|freeze|loop) 'remove' "> <!--=================== The Parallel Element ==============================--> <!-- The default for par's sync attribute is the value of the sync attribute of the SMIL root element. --> <!ENTITY % par-content "%container-content;"> <!ELEMENT par (%par-content;)*> <!ATTLIST par id ID #IMPLIED endsync CDATA "last" sync (hard|soft) #IMPLIED dur CDATA #IMPLIED repeat CDATA "1" %fill-attribute; channel IDREF #IMPLIED %sync-attributes; %switch-param-attribute; > <!--=================== The Sequential Element ============================--> <!ENTITY % seq-content "%container-content;"> <!ELEMENT seq (%seq-content;)*> <!ATTLIST seq id ID #IMPLIED dur CDATA #IMPLIED repeat CDATA "1" %fill-attribute; %sync-attributes; %switch-param-attribute; > <!--=================== The Switch Element ================================--> <!-- In the head, a switch may contain only layout elements, in the body, only container elements. However, this constraint cannot be expressed in the DTD (?), so we allow both: --> <!ENTITY % switch-content "layout|(%container-content;)"> <!ELEMENT switch (%switch-content;)*> <!ATTLIST switch id ID #IMPLIED %switch-param-attribute; > <!--=================== Media Object Elements =============================--> <!-- SMIL only defines the structure. The real media data is referenced by the src attribute of the media objects. The media objects have the following link attributes for XML linking compatibility: --> <!ENTITY % mo-XML-link-atts " xml-link (simple) #FIXED 'simple' show (embed) #FIXED 'embed' actuate (auto) #FIXED 'auto' inline (true) #FIXED 'true' "> <!-- Furthermore, they have the the following attributes as defined in the SMIL draft --> <!ENTITY % mo-attributes " id ID #IMPLIED src CDATA #REQUIRED type CDATA #IMPLIED channel IDREF #IMPLIED dur CDATA #IMPLIED repeat CDATA '1' %fill-attribute; %sync-attributes; %switch-param-attribute; %mo-XML-link-atts; "> <!-- Some of the media objects can have a range attribute --> <!ENTITY % range-attribute "range CDATA #IMPLIED"> <!-- Most info is in the attributes, media objects are empty or contain associated link elements: --> <!ELEMENT ref (%assoc-link;)*> <!ELEMENT audio (%assoc-link;)*> <!ELEMENT img (%assoc-link;)*> <!ELEMENT video (%assoc-link;)*> <!ELEMENT text (%assoc-link;)*> <!ATTLIST ref %mo-attributes; %range-attribute;> <!ATTLIST audio %mo-attributes; %range-attribute;> <!ATTLIST img %mo-attributes;> <!ATTLIST video %mo-attributes; %range-attribute;> <!ATTLIST text %mo-attributes;> <!--=================== Link Elements =====================================--> <!-- These should all conform to the XML linking elements --> <!ENTITY % link-XML-link-atts " xml-link (simple) #FIXED 'simple' actuate (user) #FIXED 'user' show (replace|new|pause) 'replace' inline (true) #FIXED 'true' role CDATA #IMPLIED content-role CDATA #IMPLIED content-title CDATA #IMPLIED behavior CDATA #IMPLIED "> <!ENTITY % smil-link-attributes " id ID #IMPLIED href CDATA #REQUIRED "> <!--=================== Inline Link Element ===============================--> <!ELEMENT a (%schedule;|switch)*> <!ATTLIST a %link-XML-link-atts; %smil-link-attributes; > <!--=================== Associated Link Element ===========================--> <!ELEMENT anchor EMPTY> <!ATTLIST anchor coords CDATA #IMPLIED iid CDATA #IMPLIED z-index CDATA "0" %smil-link-attributes; %link-XML-link-atts; %sync-attributes; >
This is an informative appendix of this specification
Imagine a news broadcast on the growth of the Web. In the first scene (see left hand side of Figure 7.1), a graph on the left hand side of the screen displays the growth of the Web. The right hand side of the screen is taken up by a video of an anchor person commenting the graph. The graph and the commentators video are set up on a background.
In the second scene (see right hand side of Figure 7.1), the graph is replaced by a video showing Tim Berners-Lee, and the anchor person starts to interview him. During the interview, the user can click on Tim's video, and Tim's homepage will be brought up (via a hyperlink).
Figure 7.1: Interactive newscast screenshots
Figure 7.2 shows the time line and some of the media components used in this presentation:
Figure 7.2: Schedule for interactive newscast scenario
Some components do not appear in Figure 7.2:
This scenario can be implemented using the following SMIL document:
<smil> <head> <layout type="text/smil-basic"> <channel id="left-video" left="20" top="50" z-index="1"/> <channel id="left-text" left="20" top="120" z-index="1"/> <channel id="right-video" left="150" top="50" z-index="1"/> <channel id="right-text" left="150" top="120" z-index="1"/> </layout> </head> <body> <par> <img src="bg"/> <seq> <par> <img src="graph" channel="left-video" dur="60s"/> <text src="graph-text" channel="left-text"/> </par> <par> <a href="http://www.w3.org/People/Berners-Lee"> <video src="tim-video" channel="left-video"/> <text src="tim-text" channel="left-text"/> </a> </par> </seq> <seq> <audio src="joe-audio"/> <audio src="tim-audio"/> </seq> <video id="jv" src="joe-video" channel="right-video"/> <text src="joe-text" channel="right-text"/> </par> </body> </smil>
Copyright © 1997 W3C (MIT, INRIA, Keio ), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.