W3C WD-smil-0202


Synchronized Multimedia Integration Language

W3C Working Draft 2-February-98

Latest version:
http://www.w3.org/TR/WD-smil
This version:
http://www.w3.org/TR/1998/WD-smil-0202
Previous version:
http://www.w3.org/TR/WD-smil-971109
Editor:
Philipp Hoschka, W3C (hoschka@w3.org)
Authors:
Stephan Bugaj, Lucent/Bell Labs
Dick Bulterman, CWI
Lynda Hardman, CWI
Jack Jansen, CWI
Rob Lanphier, RealNetworks
Nabil Layaida, INRIA
Jonathan Marsh, Microsoft
Anup Rao, Netscape
Lloyd Rutledge, CWI
Warner ten Kate, Philips
Jacco van Ossenbruggen, CWI
Michael Vernick, Lucent/Bell Labs
Jin Yu, DEC


Table of Contents


1 Status of this document

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.

2 Introduction

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:

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.

3 SMIL Document

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

4 The smil, head and body element

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

id (optional)
This attribute specifies value that uniquely identifies an element within a document.

5 The Document Head

5.1 The layout Element

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

type (optional)
The type attribute specifies which layout language is used in the layout element. If the player does not understand this language, it must skip all text up until the next "</layout>" tag. The default value of the type attribute is "text/smil-basic".

5.2 The meta Element

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:

sync
The value of this property determines the default value of the sync attribute in parallel elements within the presentation. If this attribute is not specified, the default value of sync is implementation dependent. Possible values are "hard" and "soft". For further explanation, see 6.2.
title
The value of this property contains the title of the presentation.
pics-label or PICS-Label
The value of this property specifies a valid rating label for the presentation as defined by PICS (http://www.w3.org/PICS/labels.html).

Attributes

name (mandatory)
The name attribute identifies the property.
content (mandatory)
The content attribute specifies the property value.

6 The Document Body

6.1 Schedule Elements

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.

6.2 The par Element

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

sync (optional)
This attribute specifies how accurately the children in a parallel group are synchronized in case of playback delays. Most importantly, it determines what to do if the parallel group contains two or more continuous media types such as audio or video, and one of them experiences a delay. The attribute can have the following values:
"hard"
The player must synchronize the children in the parallel group to a common clock (see Figure 6.1 a)).
"soft"
Each child of the parallel element has its own clock, which runs independently of the clocks of other children in the parallel element (see Figure 6.1 b)).
The default value for sync is specified within a "meta" element. If no default value is specified, the default value is implementation-dependent.


   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

endsync (optional)
This attribute specifies that the parallel element depends on the end time of one of its children. The attribute can have the following values:
"last" (default)
The parallel element ends when all of its children have ended (see Figure 6.2 a)). When using sync="soft", the exact duration of the parallel element can only be determined at run-time.
"first"
The parallel element ends as soon one of its children ends (see Figure 6.2 b)). When using sync="soft", the exact duration of the parallel element can only be determined at run-time.
id-ref
The parallel group ends at the same time as the child identified by the id ends.


<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

dur (optional)
This attribute specifies the difference between the begin time and the end time of the parallel element. This attribute is ignored if the par element also contains an endsync attribute.
fill (optional)
This attribute has an effect when an element is contained within another "par" or "seq" element. It determines what happens with "slack-time" that may occur once the duration of an element has ended. The exact semantics depend on the parent element:

The attribute can have the following values:

remove(default)
Display of the element ends when its duration has ended.
freeze
If the element is a non-continuous visual media object (e.g. a text or an image), the element continues to be displayed after its duration has ended. If the element is a continuous visual media object (e.g. a video), the last state of the media object (e.g. the last frame) is continued to be displayed. If the element is an audio object, this value has no effect. If the element is a par element, its children are "frozen". If the element is a seq element, the last element in the sequence is "frozen".
loop
The element is repeated from the beginning.


<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


Figure 6.3: Image as interlude element without minimal duration. The image is only shown if there is a delay in the audio start

repeat (optional)
This attribute specifies the number of times an element should be repeated. A value of "0" indicates that the element is repeated an infinite number of times. The default value is 1.

6.3 The seq Element

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.

6.4 Media Object Elements: The ref, audio, img, video and text elements

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

src (mandatory)
The value of the src attribute is the URL of the media object.
type (optional)
MIME type of the media object referenced by the src attribute
channel (optional)
This attribute specifies the identifier of an abstract rendering surface (either visual or acoustic) defined within the layout section of the document.
dur (optional)
This attribute specifies the difference between the begin time and the end time of the media object element. For continuous media objects (e.g. audio or video objects), the default value is the intrinsic duration of the media object.
range (optional)
The range attribute specifies that only a sub-clip of a continuous media object (such as audio, video or another presentation) should be played (the syntax of attribute values is copied directly from the "range" header in the RTSP Internet draft). A range has the general form <begin-timestamp> "-" <end-timestamp>. If the begin-timestamp is missing, the clip starts at the beginning of the temporal media object. If the end-timestamp is missing, the clip ends with the end of the temporal media object.
The following formats can be used for timestamps (the following text is copied directly from the RTSP Internet draft. Modifications are indicated by ellipsis (...)):
SMPTE Relative Timestamps
A SMPTE relative timestamp expresses time relative to the start of the clip. Relative timestamps are expressed as SMPTE time codes for frame-level access accuracy. The time code has the format hours:minutes:seconds:frames.subframes, with the origin at the start of the clip. The default smpte format is``SMPTE 30 drop'' format, with frame rate is 29.97 frames per second. (...) . For the ``frames'' field in the time value can assume the values 0 through 29. The difference between 30 and 29.97 frames per second is handled by dropping the first two frame indices (values 00 and 01) of every minute, except every tenth minute. If the frame value is zero, it may be omitted. Subframes are measured in one-hundredth of a frame.
Examples:
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
"
Normal Play Time
Normal Play Time expresses time relative to the start of the clip in terms of SMIL clock values.
Examples:
range="npt:123.45s-125s"
range="npt:12:05:35.3
-"

6.5 Synchronization Attributes

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
This event is generated when the element becomes active.
Example use: begin="id(x)(begin)"
end
This event is triggered when the element becomes inactive.
Example use: begin="id(x)(end)"
clock-val
This element is triggered when the clock associated with an element reaches a particular value. This clock starts at 0 when the element begins to be displayed. It is defined as follows:
  1. If the element is a media object, its associated clock gives the media time of the object. The media time of an object may differ from the presentation time that elapsed since the object's display was started e.g. due to rendering or network delays.
  2. If the element is a seq element, its associated clock gives the presentation time elapsed since the sequence element has been started.
  3. If the element is a par element that ends when an especially designated element ends (endsync=id-ref), the associated clock is equal to the clock associated with this element. Otherwise, the clock is equal to the presentation time that has elapsed since the parallel element has been started.

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

begin (optional)
The value of the begin attribute determines when the element containing this attribute gets activated, for example displayed on a screen or reproduced by a loudspeaker.
end (optional)
The value of the end attribute determines when the element containing this attribute is deactivated, for example removed from the screen or stopped being reproduced by a loudspeaker.

6.6 The switch Element

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:

  1. The parameters and their values can be retrieved over the network, e.g. by doing an http "GET header" request, or an RTSP DESCRIBE request, or as part of the actual media-object.
  2. The parameters and their values can be included with the elements in the SMIL file using attribute-value pairs.

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.

6.7 Switch Parameter Attributes

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

bitrate (optional)
This attribute specifies the average bandwidth, in bits per second that is required by the element. This could be used to make a choice based on the users connection to the network. Typical values for modem users would be 14400, 28800, 56000 etc. The attribute can assume any integer value greater than 0. Parameter values retrieved from the network override this attribute value.
language (optional)
This attribute specifies the human language used in the element. Note that this does not specify character set encodings for content such as html or text i.e., it is lingual rather than encoding related.
The attribute value can be any language name from RFC 1766 , i.e. a ISO 3166 language code with an optional ISO 639 country code. Parameter values retrieved from the network override this attribute value.
screen-size (optional)
This attribute specifies the height and width of the available viewing area (i.e screen size) in pixel units required by the element. Each of these values must be an integer value greater than 0. Parameter values retrieved from the network override this attribute value.
screen-depth (optional)
Specifies the depth of the screen color palette in bits required for displaying the element. The value must be greater than 0. Typical values are 2, 8, 24 .... Parameter values retrieved from the network override this attribute value.
new-attribute (optional)
Implementations are allowed to add implementation-specific parameters that are to be used within the "switch" element. The specification of these parameters should state clearly if parameter values retrieved from the network override the attribute value.
(this will probably be replaced by the xml-namespace mechanism in a later version of this draft)

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

6.8 Hyperlinking

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.

6.9 The a Element

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

show
This attribute controls the behavior of the source document containing the link when the link is followed. It can have one of the following values:

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

6.10 The anchor Element

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:

  1. The anchor element allows associating a link destination to spatial and temporal subparts of a media object, using the "href" attribute (in contrast, the "a" element only allows associating a link with the whole media object).
  2. The anchor element allows that a subpart of the media object can become the destination of a link, using the "id" attribute.
  3. The anchor element allows breaking up an object into spatial subparts, using the "coords" attribute.
  4. The anchor element allows breaking up an object into temporal subparts, using the "begin" and "end" attributes. The values of the begin and end attributes are relative to the beginning of the media object.
  5. Some media formats such as CGM or HTML already provide an internal mechanism for associating an identifier with a subparts of a media object expressed in this format. The anchor element allows accessing these subparts, using the "iid" attribute.

An anchor element has implicit attributes xml-link="simple" and inline="true".

Attributes

coords
The value of this attribute specifies a rectangle within the display area of a visual media object. The rectangle is specified by four values:. The first two values specify the coordinates of the upper left corner of the rectangle.The second two values specify the coordinates of the lower right corner of the rectangle. Coordinates are relative to the top left corner of the visual media object (see Figure 6.7). If a coordinate is specified as a percentage value, it is relative to the total width or height of the media object display area. Syntax and semantics of this attribute are identical to the coords attribute in HTML image maps, when the link is associated with a rectangular shape. When two rectangles overlap, the one with the higher z-index value takes precedence.
z-index
This attribute specifies the stacking order of elements in the case that their rendering spaces overlap. Its value is a non-negative integer. Elements are stacked in order of increasing z-index value (i.e. highest z-index value on top). The default value is 0. When two elements have the same z-index and overlap both in time and in space, their stacking order is defined by the following rules:
  1. If the display of an element A starts later than the display of an element B, A is stacked on top of B (temporal order).
  2. If the display of the elements starts at the same time, and an element A occurs later in the SMIL document text than an element B, A is stacked on top of B (textual order).
iid
The value of this attribute is the media-format internal identifier of a subpart that is contained in the media object. This attribute can be used with media formats that have an internal mechanism for associating an identifier with a subpart of a media object encoded in this format. Note that conversion may be necessary to turn the media-format internal identifier into a string containing only legal XML characters.


           Media Object Display Area
                    |
 0,0               \ /
   +-----------------------------------+  
   |       / \            / \          |       
   |        |              |           |   
   |        | top-y        |           |             
   |        |              |           |   
   |       \ /             | bottom-y  |   
   |left-x|-------------|  |           |    
   |<---->|             |  |           |   
   |      |             |  |           |   
   |      |             |  |           |   
   |      |-------------| \ /          |   
   |                                   |
   |      right-x                      |   
   |<------------------->              |   
   |                                   |   
   |                                   |   
   |                                   |   
   +-----------------------------------+  

  


Figure 6.7: Semantics of "coords" attribute

Attribute Values

length
A length value can have two forms:
  1. Pixel value: The length is given in reference pixels. The size of a reference pixel is defined in the CSS1 specification: "If the pixel density of the output device is very different from that of a typical computer display, the UA should rescale pixel values. The suggested reference pixel is the visual angle of one pixel on a device with a pixel density of 90dpi and a distance from the reader of an arm's length. For a nominal arm's length of 28 inches, the visual angle is about 0.0227 degrees."
  2. Percentage value: The length is given as a percentage of another length.

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>

7 Appendix

7.1 SMIL Basic Layout

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

Relation to CSS

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

left
This attribute specifies the length of the offset between the element and the left border of the rendering window (see Figure 7.1). If the length is given as percentage, it is relative to the rendering window's width. The default value is 0 pixels.
top
This attribute specifies the length of the offset between the element and the top border of the rendering window (see Figure 7.1). If the length is given as a percentage, it is relative to the rendering window's height. The default value is 0 pixels.

Rendering Window | 0,0 \ / +-----------------------------------+ / \ | / \ | | | | | | | | top | | | | | | | \ / | | | left |-------------| / \ | | Rendering Height |<---->| | | | | | | | | height | | | | | | | | | |-------------| \ / | | | | | | <-------------> | | | width | | +-----------------------------------+ \ / <-----------------------------------> Rendering Width


Figure 7.1: Semantics of left, top, width and height attributes

width
This attribute specifies the horizontal length or width of the space in which the object is rendered (see Figure 7.1). If the width is given as a percentage, it is relative to the total width of the rendering window in which the object appears. The default value can be the natural width of the object, i.e. the width stored in the objects data. If no natural width is available, the default value is the difference between the "left" coordinate of the object and the right border of the window.
height
This attribute specifies the vertical length or height of the space in which the object is rendered (see Figure 7.1). If the height is given as a percentage, it is relative to the total height of the rendering window in which the object appears. The default value can be the natural height of the object, i.e. the height stored in the objects data. If no natural height is available, the default value is the difference between the "top" coordinate of the object and the bottom border of the window.
scale
This attribute specifies what happens if the intrinsic height and width of a visual media object differ from the values specified by the height and width attributes. The following list defines the legal attribute values. The definition of the values "visible", "hidden", "auto" and "scroll" is taken from the "overflow" property in the CSS-2 draft (http://www.w3.org/Style/Group/9712/WD-css2-971211/flowobj2.html#overflow), with text-specific considerations (direction of writing, padding and border) removed.  
meet (default)
Scale the visual media object while preserving its aspect ratio until its height or width is equal to the value specified in by the height or width attributes, while none of the content is clipped. This is the default value. Empty space is added at the top and bottom or left and right so that the object is centered within the rectangle defined by top, left, height and width.
slice
Scale the visual media object while preserving its aspect ratio so that its height or width are equal to the value specified by the height and width attributes while some of the content may get clipped. Depending on the exact situation, either a horizontal or a vertical slice of the visual media object is displayed. Overflow width will be clipped from the right of the media object. Overflow height will be clipped from the bottom of the media object.
fill
Scale the X and Y dimensions independently so that the content just  touches all edges of the channel (This is the standard behavior of the "img" tag in HTML).
visible
A value of 'visible' indicates that the element's width and height should be enlarged enough to contain all of its rendered contents. In other words, its height or width can be made bigger than the declared value. Any additional width will be added to the right. Additional height will be added to the bottom.
hidden
A value of 'hidden' indicates that the element's contents should be clipped to the values given by the height and width attributes, and that no scrolling mechanism should be provided. Any contents that exceed the height and width values will be unavailable to the user. Overflow width will be clipped from the right of the media object. Overflow height will be clipped from the bottom of the media object.
auto
The behavior of the 'auto' value is player-dependent, but should cause a scrolling mechanism to be invoked when the element's rendered contents exceed its bounds.
scroll
The 'scroll' value indicates that if the player supports a visible scrolling mechanism, that mechanism should be displayed whether or not the element's rendered contents exceed its bounds. This avoids any problem with scrollbars appearing and disappearing in a dynamic environment.

7.2 Augmented BNF Notation

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:

name = definition
The name of a rule is simply the name itself (without any enclosing "<" and ">") and is separated from its definition by the equal "=" character. Whitespace is only significant in that indentation of continuation lines is used to indicate a rule definition that spans more than one line. Certain basic rules are in uppercase, such as SP, LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle brackets are used within definitions whenever their presence will facilitate discerning the use of rule names.
"literal"
Quotation marks surround literal text. Unless stated otherwise, the text is case-insensitive.
rule1 | rule2
Elements separated by a bar ("|") are alternatives, for example, "yes | no" will accept yes or no.
(rule1 rule2)
Elements enclosed in parentheses are treated as a single element. Thus, "(elem (foo | bar) elem)" allows the token sequences "elem foo elem" and "elem bar elem".
*rule
The character "*" preceding an element indicates repetition. The full form is "<n>*<m&gtelement" indicating at least <n> and at most <m> occurrences of element. Default values are 0 and infinity so that "*(element)" allows any number, including zero; "1*element" requires at least one; and "1*2element" allows one or two.
[rule]
Square brackets enclose optional elements; "[foo bar]" is equivalent to "*1(foo bar)".
N rule
Specific repetition: "<n>(element)" is equivalent to "<n>*<n>(element)"; that is, exactly <n> occurrences of (element). Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three alphabetic characters.
#rule
A construct "#" is defined, similar to "*", for defining lists of elements. The full form is "<n>#<m&gtelement " indicating at least <n> and at most <m> elements, each separated by one or more commas (",") and optional linear whitespace (LWS). This makes the usual form of lists very easy; a rule such as "( *LWS element *( *LWS "," *LWS element )) " can be shown as "1#element". Wherever this construct is used, null elements are allowed, but do not contribute to the count of elements present. That is, "(element), , (element) " is permitted, but counts as only two elements. Therefore, where at least one element is required, at least one non-null element must be present. Default values are 0 and infinity so that "#element" allows any number, including zero; "1#element" requires at least one; and "1#2element" allows one or two.
; comment
A semi-colon, set off some distance to the right of rule text, starts a comment that continues to the end of line. This is a simple way of including useful notes in parallel with the specifications.
implied *LWS
The grammar described by this specification is token-based. Except where noted otherwise, linear whitespace (LWS) can be included between any two adjacent tokens, and between adjacent tokens and delimiters (tspecials), without changing the interpretation of a field. At least one delimiter (tspecials) must exist between any two tokens, since they would otherwise be interpreted as a single token.

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

7.3 SMIL DTD

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

7.4 Example: Interactive Newscast on Growth of the Web

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.