Informative
SMIL 1.0 solved fundamental media synchronization problems and defined a powerful way of choreographing multimedia content. SMIL Boston extends the timing and synchronization support, adding capabilities to the timing model and associated syntax. Some SMIL 1.0 syntax has been changed or deprecated. This section of the document specifies the Timing and Synchronization module.
There are two intended audiences for this module: implementers of SMIL Boston document viewers or authoring tools, and authors of other XML languages who wish to integrate timing and synchronization support. A language with which this module is integrated is referred to as a host language. A document containing SMIL Timing and Synchronization elements and attributes is referred to as a host document.
As this module is used in different profiles (i.e. host languages), the associated syntax requirements may vary. Differences in syntax should be minimized as much as is practical.
This section is informative.
SMIL Timing defines elements and attributes to coordinate and synchronize the presentation of media over time. The term media covers a broad range, including discrete media types such as still images, text, and vector graphics, as well as continuous media types that are intrinsically time-based, such as video, audio and animation.
Three synchronization elements support common timing use-cases:
These elements are referred to as time containers. They group their contained children together into coordinated timelines.
SMIL Timing also provides attributes that can be used to specify an element's timing behavior. Elements have a begin, and a simple duration. The begin can be specified in various ways - for example, an element can begin at a given time, or based upon when another element begins, or when some event (such as a mouse click) happens. The simple duration defines the basic presentation duration of an element. Elements can be defined to repeat the simple duration, a number of times or for an amount of time. The simple duration and any effects of repeat are combined to define the active duration. When an element's active duration has ended, the element can either be removed from the presentation or frozen (held in its final state), e.g. to fill any gaps in the presentation.
Figure 1 illustrates the basic support of a repeating element within a simple <par> time container. The corresponding syntax is included with the diagram.
<par begin="0s" dur="33s"> <video begin="1s" dur="10s" repeatCount="2.5" fill="freeze" .../> </par>
Figure 1 - Strip diagram of basic timing support. The starred "Simple*" duration indicates that the simple duration is partial (i.e. it is cut off early).
The attributes that control these aspects of timing can be applied not only to media elements, but to the time containers as well. This allows, for example, an entire sequence to be repeated, and to be coordinated as a unit with other media and time containers. While authors can specify a particular simple duration for a time container, it is often easier to leave the duration unspecified, in which case the simple duration is defined by the contained child elements. When an element does not specify a simple duration, the time model defines an implicit simple duration for the element. For example, the implicit simple duration of a sequence is based upon the sum of the active durations of all the children.
Each time container also imposes certain defaults and constraints upon the contained children. For example in a <seq>, elements begin by default right after the previous element ends, and in all time containers, the active duration of child elements is constrained not to extend past the end of the time container's simple duration. Figure 2 illustrates the effects of a repeating <par> time container as it constrains a <video> child element.
<par begin="0s" dur="12s" repeatDur="33s" fill="freeze" > <video begin="1s" dur="5s" repeatCount="1.8" fill="freeze" .../> </par>
Figure 2 - Strip diagram of time container constraints upon child elements. The starred "Simple*" durations indicate that the simple duration is partial (i.e. it is cut off early).
The SMIL Timing Model defines how the time container elements and timing attributes are interpreted to construct a time graph. The time graph is a model of the presentation schedule and synchronization relationships. The time graph is a dynamic structure, changing to reflect the effect of user events, media delivery, and DOM control of the presentation. At any given instant, the time graph models the document at that instant, and the semantics described in this module. However, as user events or other factors cause changes to elements, the semantic rules are re-evaluated to yield an updated time graph.
In an ideal environment, the presentation would perform precisely as specified. However, various real-world limitations (such as network delays) can influence the actual playback of media. How the presentation application adapts and manages the presentation in response to media playback problems is termed runtime synchronization behavior. SMIL includes attributes that allow the author to control the runtime synchronization behavior for a presentation.
Informative
The timing model is defined by building up from the simplest to the most complex concepts: first the basic timing and simple duration controls, followed by the attributes that control repeating and constraining the active duration. Finally, the elements that define time containers are presented.
The time model depends upon several definitions for the host document: A host document is presented over a certain time interval.
This section defines the set of timing attributes that are common to all of the SMIL synchronization elements.
@@ Need to define "local time" or find a different term.
@@ In order to support an MPEG 4 effort to use SMIL Boston Timing and Synchronization, we are considering the addition of two additional attributes:
We are probably going to add an additional attribute "min" that would take a simple clock value and constrain the active duration to be at least as long as the specified duration. This new attribute would not affect the parent constraint semantics, and the impact on the timing model will be minimized.
We are considering a "max" attribute that would specify a maximum active duration for an element.
Informative
The basic timing for an element is described using the begin and dur attributes. Authors can specify the begin time of an element in a variety of ways, ranging from simple clock times to the time that an event (e.g. a mouse-click) happens. The simple duration of an element is specified as a simple time value. The begin attribute syntax is described below. The normative syntax rules for each attribute value variant are described below (in Timing attribute value grammars); a syntax summary is provided here as an aid to the reader.
Normative
Normative
Informative
Children of a
<par> begin by default when the
<par> begins (equivalent to
begin="0"). Children of a
<seq> begin by default when the
previous child ends its active duration (equivalent to
begin="0"). Children of an
<excl> default to a begin value
of "indefinite".
The begin value can specify a list of times. This can be used to specify multiple "ways" or "rules" to begin an element, e.g. if any one of several events is raised. A list of times can also define multiple begin times, allowing the element to play more than once (this behavior can be controlled, e.g. to only allow the earliest begin to actually be used - see also The restart attribute).
In general, the earliest time in the list determines the begin time of the element. There are additional constraints upon the evaluation of the begin time list, detailed in Evaluation of begin and end time lists.
Note that while it is legal to include "indefinite" in a list of values for begin, "indefinite" is only really useful as a single value. Combining it with other values does not impact the timing, as DOM begin methods can be called with or without specifying "indefinite" for begin.
When a begin time is specified as a syncbase variant, a marker value or a wallclock value, the defined time must be converted by the implementation to a time that is relative to the parent time container (i.e. to the equivalent of an offset value). This is know as timespace conversion, and is detailed in the section Converting between local and global times.
Informative
The use of negative offsets to define begin times merely defines the synchronization relationship of the element. It does not in any way override the time container constraints upon the element, and it cannot override the constraints of presentation time.
Normative
Informative
If an element has a begin time that resolves to a time before the parent time container begins, the parent time container constraint still applies. For example:
<par> <video id="vid" begin="-5s" dur="10s" src="movie.mpg" /> <audio begin="vid.begin+2s" dur="8s" src="sound.au" /> </par>
The video element cannot begin before the par begins. The begin is simply defined to occur "in the past" when the par begins. The viewer will observe that the video begins 5 seconds into the media, and ends after 5 seconds. Note that the audio element begins relative to the video begin, and that the computed begin time is used, and not the observed begin time as constrained by the parent. Thus the audio begins 3 seconds into the media, and also lasts 5 seconds.
The behavior can be thought of as a clipBegin value applied to the element, that only applies to the first iteration of repeating elements. In the example above, if either element were defined to repeat, the second and later iterations of the media would play from the beginning of the media (see also The repeatCount, repeatDur, and repeat attributes: repeating elements).
Normative
The behavior can be thought of as a clipBegin value applied to the element, that only applies to the first iteration of repeating elements.
The media will actually begin at the time computed according to the following algorithm:
Let o be the offset value, d is the simple duration, AD is the active duration. If AD is indefinite, it compares greater than any value of o or ABS(o). REM( x, y ) is defined as x - floor( x/y ). If y is indefinite, REM( x, y ) is just x.
If ABS(o) >= AD the element does not begin.
Else the element media begins at REM( ABS(o), d ).
If the element repeats, the iteration value of the
repeat event has the calculated value based upon the computed
begin, and not the observed number of repeats.
Informative
Thus for example:
<ref begin="foo.click-8s" dur="3s" repeatCount="10" .../>
The element begins when the user clicks on the
element "foo". It begins to play at 2 seconds into the 3 second simple duration.
Any time dependents are activated relative to the computed begin time, and
not the observed begin time. The begin event is raised
when the element begins, but has a timeStamp value that corresponds
to the defined begin time, 8 seconds earlier. One second later, the element
will repeat, and the associated repeat event will have the iteration
value set to 3 (it is zero based). The element will end 22 seconds after
the click.
Note: If script authors wish to distinguish between
the computed repeat iterations and observed repeat iterations, they can count
actual repeat events in the associated event handler.
@@Should we remove the following?
A begin time (ultimately) specifies a synchronization relationship between the element and the parent time container. Syncbase variants, eventbase, marker and wallclock timing are implicitly converted to an offset on the parent time container, just as an offset value specifies this directly. For children of a <seq>, the result is always a positive offset from the begin of the <seq> time container. However, for children of <par> and <excl> time containers the computed offset relative to the parent begin time may be negative.
If the computed begin offset is negative, the time container constraints specify that the element cannot actually begin until the parent time container begins. Nevertheless, the element behaves as though it had begun earlier. A negative begin offset can be thought of as defining a clipBegin value (with the same magnitude) for the first -- and only the first -- iteration of a repeated element. If no repeat behavior is specified, a negative begin offset is equivalent to a clipBegin specification with the same magnitude as the offset value.
The length of the simple duration is specified using the dur attribute. The dur attribute syntax is described below.
Normative
@@We are also considering adding a value "intrinsic" for dur (and possibly min and max). This would allow the author to specify that the duration is the default intrinsic media duration. This is useful to control the semantic interaction with "end".
If there is any error in the argument value syntax for dur , the attribute will be ignored (as though it were not specified).
If the element does not have a (valid) dur attribute, the simple duration for the element is defined to be the implicit duration of the element. The implicit duration depends upon the type of an element. The primary distinction is between different types of media elements and time containers.
If the media element has no time children, it is described as a simple media element.
If the author specifies a value for dur that is shorter than the "intrinsic" defined duration for an element, the intrinsic duration will be cut short by the specified simple duration.
If the author specifies a simple duration that is longer than the "intrinsic" defined duration for an element, the intrinsic duration of the element is extended to the specified dimple duration:
Note that when the simple duration is "indefinite", some simple use cases can yield surprising results. See the related example #4.
Informative
Note that when the begin attribute refers to an event, or to the begin or active end of another element, it may not be possible to calculate when the begin will happen. For example, if an element is defined to begin on some event, the begin time will not be known until the event happens. When such a time becomes known (i.e. when it can be calculated as a presentation time), the time is said to be resolved (see also the discussion of Unifying scheduled and interactive timing).
The following example shows simple offset begin timing. The <audio> element begins 5 seconds after the <par> time container begins, and ends 4 seconds later.
<par> <audio src="song1.au" begin="5s" dur="4s" /> </par>
The following example shows syncbase begin timing. The <img> element begins 2 seconds after the <audio> element begins.
<par> <audio id="song1" src="song1.au" /> <img src="img1.jpg" begin="song1.begin+2s" /> </par>
Elements can also be specified to begin in response to an event. In this example, the image element begins (appears) when the user clicks on element "show". The image will end (disappear) 3 and a half seconds later.
<text id="show" ... /> <img begin="show.click" dur="3.5s" ... />
Informative
SMIL Boston provides an additional control over the active duration. The end attribute allows the author to constrain the active duration by specifying an end value using a simple offset, a time base, an event-base or DOM methods calls. The rules for combining the attributes to compute the active duration are presented in the section, Computing the active duration.
The normative syntax rules for each attribute value variant are described in the section Timing attribute value grammars; a syntax summary is provided here as an aid to the reader.
Normative
endElement() method call.The earliest time in the list in the end time list determines the end value used in Computing the Active Duration.
In the case where an element can begin multiple times, the end value used is the earliest end time after the current begin time. There are additional constraints upon the evaluation of the begin and end time lists, detailed in Evaluation of begin and end time lists.
@@ PLS: The above change could be interpreted to change the semantics - it
could be read to mean that the ending state is shown throughout the simple
duration. Perhaps it needs more wordsmithing form the original, but
we need to say that the media is played for its implicit duration, and then
the ending state is shown for the remainder of the specified simple
duration.
How about:
"When the end value extends the active duration beyond an element's implicit
simple duration, the ending state of the media (e.g. the last frame of video)
will be shown from the end of the implicit simple duration to the end of
the active duration."
Actually, this is also bad, as it needs to be clearer that a) this only applies to media elements and not to time containers, and b) this applies to elements with no dur specified (yes, that is the definition of implicit, but we should be clearer).
Informative
The end value can specify a list of times. This can be used to specify multiple "ways" or "rules" to end an element, e.g. if any one of several events is raised. A list of times can also define multiple end times that can correspond to multiple begin times, allowing the element to play more than once (this behavior can be controlled - see also The restart attribute).
In the following example, the dur attribute is not specified, and so the simple duration is defined to be the implicit media duration. In this case (and this case only) the value of end will extend the active duration if it specifies a duration greater than the implicit (media) duration.
Informative
In the following example, the video will be shown for 8 seconds, and then the last frame will be shown for 2 seconds.
<video end="10s" src="8-SecondVideo.mpg" .../>
Normative
If the end value
becomes resolved while the element is still active, and the resolved time
is in the past, the element should end the active duration immediately. Time
dependents defined relative to the end of this element should be resolved
using the computed active end (which may be in the past), and not the observed
active end.
Informative
These cases arise from the use of negative offsets in the sync-base and event-base forms, and authors should be aware of the complexities this can introduce. See also Handling negative offsets for end.
In the following example, the active duration will end at the earlier of 10 seconds, or the end of the "foo" element. This is particularly useful if "foo" is defined to begin or end relative to an event.
<audio src="foo.au" dur="2s" repeatDur="10s" end="foo.end" .../>
In the following example, the active duration will end at 10 seconds, and will cut short the simple duration defined to be 20 seconds. The effect is that only the first half of the element is actually played. For a simple media element, the author could just specify this using the dur attribute. However in other cases, it is sometimes important to specify the simple duration independent of the active duration.
<par> <audio src="music.au" dur="20s" end="10s" ... /> </par>
In the following example, the element begins when the user clicks on the "gobtn" element. The active duration will end 30 seconds after the parent time container begins.
<par> <audio src="music.au" begin="gobtn.click" repeatDur="indefinite" end="30s" ... /> <img src="foo.jpg" dur="40s" ... /> </par>
Note that if the user has not clicked on the target element before 30 seconds elapse, the element will never begin. In this case, the element has no active duration and no active end.
The defaults for the event syntax make it easy to define simple interactive behavior. The following example stops the image when the user clicks on the element.
<image src="image.jpg" end="click" />
Using end with an event value enables authors to end an element based on either an interactive event or a maximum active duration. This is sometimes known as lazy interaction.
In this example, a presentation describes factory processes. Each step is a video, and set to repeat 3 times to make the point clear. Each element can also be ended by clicking on the video, or on some element "next" that indicates to the user that the next step should be shown.
<seq> <video dur="5s" repeatCount="3" end="click; next.click" .../> <video dur="5s" repeatCount="3" end="click; next.click" .../> <video dur="5s" repeatCount="3" end="click; next.click" .../> <video dur="5s" repeatCount="3" end="click; next.click" .../> <video dur="5s" repeatCount="3" end="click; next.click" .../> </seq>
In this case, the active end of each element is defined to be the earlier of 15 (5s dur * 3 repeats) seconds after it begins, or a click on "next". This lets the viewer sit back and watch, or advance the presentation at a faster pace.
Normative
@@ If min and max can take lists of values, this section must be generalized to account for this.
The lists of begin and end times can define more than one instance of the active duration for an element. Each active duration instance behaves according to the rules described for interpreting the simple duration, repeat behavior and the definition of the active duration. The following semantics are used to evaluate the lists of begin and end times to determine the begin and end time for each interval.
The begin and end times that this semantic produces are not necessarily the begin and end of the active duration. Rather, they are the inputs used to the rest of the timing semantics, for a given instance of the active duration. Thus, an end value obtained here is considered within the semantics of Computing the active duration, and a begin value obtained here must be evaluated according to the semantics of restart.
If at any time one of the times in the begin or end list changes (e.g. when an unresolved value is resolved), the semantics described here may need to be re-evaluated.
See also the discussion of Propagating changes to times.
For each set of times (begin and end), the model describes two lists. One list reflects the syntax, and contains all the specified values for begin or end. The second list in the model contains only the resolved times for begin or end of an element. This model of a separate list for the resolved times addresses three issues:
As a time is resolved, it is considered for addition to the list of resolved times. For begin times, if the early evaluation of restart semantics precludes a candidate begin time, then it is not added to the list, and is effectively dropped. If the begin specification includes an instance of "indefinite" as a begin value, the indefinite value is ignored in creating the list of resolved begin times. An instance of "indefinite" in the end specification will be included in the list of resolved end times.
Times in the resolved times lists may change, if the associated time specification is defined relative to a sync-base and the sync-base time changes. Resolved times associated with an event-based specification will not change, but the event-base specification may resolve again, adding an additional time to a resolved times list. When an element is reset (e.g. when it begins or restarts, or when an ancestor restarts), all event-based times are reset (cleared), and so the resolved times lists must be updated to reflect this.
The times in the resolved times lists are all relative to the beginning of the parent simple duration (this is the common denominator among different time specifications). The resolved times lists are assumed to be sorted from earliest to latest. The order of specification (i.e., the order in the original syntax) is ignored in the evaluation of the begin and end lists.
The lists of times are considered to model a set of intervals. These may or may not be defined by pairs of times in the two lists. It is not the case that each ith interval is defined by the ith begin time and the ith end time in the respective lists. Rather, the intervals are defined by considering the two lists of resolved times in sorted order. For any given begin time, the associated interval ends with the next end time after the begin time. In this model, any end times before the first begin are initially passed over (ignored); however if there are no other end times, then the logic will still apply a "rejected" end time. There may be more than one begin time that shares the same end time in defining the respective intervals. In addition, when evaluating the resolved times lists, the end time for a given interval may be indefinite or unresolved.
This describes the basic recipe for getting the next interval defined by
the resolved times lists. The notion of "next" is after some time on the
parent simple duration. It is assumed that there is some pseudo time value
-INFINITY that can be used to get the first possible
interval for an element - the recipe could also be modified to just get the
first interval if so desired.
This recipe is generally useful when a parent simple duration is beginning, or when a child element has just ended, and the next interval is needed. The algorithm ignores all issues related to restart, and so is most useful when the element is not active at the "after" time.
Steps to get the next interval, relative to an "after" time:
Note the exception for begin times associated with DOM method calls.
If a beginElement() or a
beginElementAt() call specifies a begin time after the last
end time (with no unresolved end times), the active duration is unconstrained,
as though no end had been specified.
See also Supported methods.
Another more complicated recipe will be required for getting the currently active, or next scheduled interval defined by the resolved times lists, for a given point on the parent simple duration. This recipe is particularly useful when a seek operation is performed on a parent and the time graph must jump into the middle of a parent simple duration.
The approach is similar to the previous "get next interval" logic, except that this will attempt to calculate the effects of restart semantics up to the "seek" point. If the element is calculated to be active at the "seek" time, the bounding interval is determined. If the element is not active and there is a next interval, then that is the result.
The logic is more complex as well because it must calculate the active duration, and not just the end time.
Get first begin and end times, using "get next interval" logic, above. Calculate associated active duration, using the obtained end time and the semantics in Computing the active duration. If the active duration is indefinite or unresolved, it is considered open ended, and contains all times at or after the begin time.
Loop over the following steps until a result is obtained:
[ End of Loop ]
Normative
In the syntax specifications that follow, allowed white space is indicated as "S", defined as follows (taken from the [XML10] definition for "S"):
S ::= (#x20 | #x9 | #xD | #xA)*
Normative
A begin-value-list is a semi-colon separated list of timing specifiers:
begin-value-list ::= begin-value (S";"Sbegin-value-list )? begin-value ::= (offset-value | syncbase-value | syncToPrev-value | event-value | media-marker-value | wallclock-sync-value | "indefinite" )
Normative
An end-value-list is a semi-colon separated list of timing specifiers:
end-value-list ::= end-value (S";"Send-value-list )? end-value ::= (clock-value | syncbase-value | syncToPrev-value | event-value | media-marker-value | wallclock-sync-value | "indefinite" )
Several of the timing specification values have
a similar syntax. In addition, XML ID attributes are allowed to contain the
dot '.' separator character. The
backslash character '\' can be used to escape the dot separator within identifier
and event-name references. To parse an individual item in a value-list, the
following approach defines the correct interpretation.
'+' or '-'), the value should be
parsed as an offset value.
.' separator characters preceded by a backslash
'\' escape character.
.' separator
character, then the value should be parsed as an
event-value with an unspecified (i.e.
default) eventbase-element.
.begin" or ".end", then the value should be parsed
as a syncbase-value.
.marker(", then the value should be parsed as a
media-marker-value.
@@Note that this approach essentially reserves the following tokens: prev and wallclock for element IDs, and begin, end and marker for event names.
Clock values have the following syntax:
Clock-val ::= ( Full-clock-val | Partial-clock-val | Timecount-val ) Full-clock-val ::= Hours ":" Minutes ":" Seconds ("." Fraction)? Partial-clock-val ::= Minutes ":" Seconds ("." Fraction)? Timecount-val ::= Timecount ("." Fraction)? (Metric)? Metric ::= "h" | "min" | "s" | "ms" Hours ::= DIGIT+; any positive number Minutes ::= 2DIGIT; range from 00 to 59 Seconds ::= 2DIGIT; range from 00 to 59 Fraction ::= DIGIT+ Timecount ::= DIGIT+ 2DIGIT ::= DIGIT DIGIT DIGIT ::= [0-9]
For Timecount values, the default metric suffix is "s" (for seconds). No embedded white space is allowed in clock values, although leading and trailing white space characters will be ignored.
The following are examples of legal clock values:
02:30:03 = 2 hours, 30 minutes and 3
seconds 50:00:10.25 = 50 hours, 10 seconds and 250 milliseconds
02:33 = 2 minutes and 33 seconds 00:10.5 = 10.5 seconds = 10 seconds and 500 milliseconds
3.2h = 3.2 hours = 3 hours and 12
minutes 45min = 45 minutes 30s = 30 seconds 5ms = 5 milliseconds 12.467 = 12 seconds and 467 milliseconds
Fractional values are just (base 10) floating point
definitions of seconds. The number of digits allowed is unlimited (although
actual precision may vary among implementations).
For example:
00.5s = 500 milliseconds 00:00.005 = 5 milliseconds
Offset values are used to specify when an element should begin or end relative to its syncbase.
Normative
An offset value has the following syntax:
offset-value ::= ( "+" | "-" )?( Clock-value )
The implicit syncbase for an offset value is dependent upon the time container:
Although SMIL Boston provides new syncbase syntax, SMIL 1.0 syncbase syntax must be supported by SMIL document players.
smil-1-syncbase-value ::= "id(" id-ref ")" ( "(" ( "begin" | "end" | clock-value) ")" )?
Normative
ID reference values are references to the value of an "id" attribute of another element in the document.
Id-value ::= IDREF
A syncbase value starts with a Syncbase-element term defining the value of an "id" attribute of another element referred to as the syncbase element.
Normative
A syncbase value has the following syntax:
Syncbase-value ::= (
Syncbase-element "." Time-symbol )
( S ("+"|"-")
S Clock-value )?
Syncbase-element ::= Id-value
Time-symbol ::= "begin" | "end"
@@ BMS - long sync arcs are allowed!
The syncbase element is qualified with one of the following time symbols:
Examples:
begin="x.end-5s"
: Begin 5 seconds before "x" ends
begin=" x.begin " : Begin when
"x" begins
begin="x.begin + 1m" : End 1 minute after
"x" begins
Informative
A sync-to-prev value is much like a syncbase value, except that the reserved token "prev" is used in place of the Syncbase-element term. The Time-symbol and optional Clock-value offset are as defined for syncbase values.
Normative
A sync-to-prev value has the following syntax:
SyncToPrev-value ::= ( "prev."
Time-symbol )
(
S ("+"|"-")
S Clock-value )?
Informative
Note that the parent time container may not be the immediate parent of the current node, in some host documents.
The Clock-value offset is nevertheless added to the parent time container begin time, to yield the resulting time value.
@@This requires more complete examples, or we need to include them above somewhere. We need good examples of how this is used.
Examples:
begin="prev.end-5s"
: Begin 5 seconds before the previous element ends
begin=" prev.begin " : Begin
when the previous element begins
begin="prev.begin + 1m" : End 1 minute after
the previous element begins
Informative
An Event value starts with an Eventbase-element term that specifies the event-base element. The event-base element is the element on which the event is observed. Given DOM event bubbling, the event-base element may be either the element that raised the event, or it may be an ancestor element on which the bubbled event can be observed. Refer to DOM-Level2-Events [DOM2Events] for details.
Normative
An event value has the following syntax:
Event-value ::= ( Eventbase-element "."
)? Event-symbol
( S ("+"|"-")
S Clock-value )?
Eventbase-element ::= Id-value
The "Id-value" is the value of an attribute declared to be of type ID (per the XML definition) in the host language, for the event-base element. This element must be another element contained in the host document.
If the Eventbase-element term is missing, the event-base element defaults to the element on which the eventbase timing is specified (the current element).
The event value must specify an Event-symbol. This term specifies the name of the event that is raised on the Event-base element. The host language designer must specify which events can be specified.
If an integrating language specifies no supported events, the event-base time value is effectively unsupported for that language.
If the host language allows dynamically created events (as supported by DOM-Level2-Events [DOM2Events]), all possible Event-symbol names cannot be specified and so unrecognized names may not be considered errors.
Unless explicitly specified by a host language, it is not considered an error to specify an event that cannot be raised on the Event-base element (such as click for audio or other non-visual elements). Since the event will never be raised on the specified element, the event-base value will never be resolved.
The last term specifies an optional offset-value that is an offset from the time of the event.
Informative
If the eventbase element has no associated layout (e.g. a time container in a SMIL document), then some UI events may not be defined (e.g. mouse events). A host language designer may override the definition of the default eventbase element. As an example of this, the SMIL Animation elements (animate, animateMotion, etc.) specify that the default eventbase element is the target element of the animation. See also [[SMIL Animation]].
This module defines several events that may be included in the supported
set for a host language, including beginEvent and
endEvent. These should not be confused with the syncbase time
values. See the section on Events
and event model.
The semantics of event-based timing are detailed in Unifying Scheduling and Interactive Timing. Constraints on event sensitivity are detailed in Event sensitivity.
Examples:
begin=" x.load "
: Begin when "load" is observed on "x"
begin="x.focus+3s" : Begin
3 seconds after an "focus" event on "x"
begin="x.endEvent+1.5s" : Begin 1 and a half seconds after
an "endEvent" event on "x"
begin="x.repeat" :
Begin each time a repeat event is observed on "x"
The following example describes a qualified repeat eventbase value:
<video id="foo" repeatCount="10" end="endVideo.click" ... /> <img id="endVideo" begin="foo.repeat(2)" .../>
The "endVideo" image will appear when the video "foo" repeats the second time. This example allows the user to stop the video after it has played though at least twice.
Repeat values are a variant on event values that support a qualified repeat
event. The repeat event defined in
Events and event model allows an additional
suffix to qualify the event based upon an iteration value.
A repeat value has the following syntax:
Repeat-value ::= ( Eventbase-element
"." )? "repeat(" iteration ")"
( S ("+"|"-")
S Clock-value )?
iteration ::=
Integer
If this qualified form is used, the eventbase value will be only be resolved when a repeat is observed that has a iteration value that matches the specified iteration.
The qualified repeat event syntax allows an author to respond only to an individual repeat of an element.
AccessKey values allow an author to tie a begin or end time to a particular keypress, indepedent of focus issues. It is modeled on the HTML accessKey support. Unlike with HTML, user agents should not require that a modifer key (such as "ALT") be required to activate an access key.
An accesskey value has the following syntax:
AccessKey-value ::= "accessKey(" character ")"
The character is a single character from [ISO10646].
@@ [Thierry] If we do not have the above reference, please use the reference cited at: http://www.w3.org/TR/html4/references.html#ref-ISO10646
The time value is defined as the time that the accessKey character is input by the user.
Certain types of media can have associated marker values that associate a name with a particular point (i.e. a time) in the media. The media marker value provides a means of defining a begin or end time in terms of these marker values. Note that if the referenced id is not associated with a media element that supports markers, or if the specified marker name is not defined by the media element, the associated time may never be resolved.
Normative
Media-Marker-value ::= Id-value ".marker(" S marker-symbol S ")" )
Informative
Wallclock-sync values have the following syntax. The values allowed are based upon several of the "profiles" described in [DATETIME], which is based upon [ISO8601].
Normative
wallclock-val ::= "wallclock(" S (DateTime | WallTime) S ")" DateTime ::= Date "T" WallTime Date ::= Years "-" Months "-" Days WallTime ::= (HHMM-Time | HHMMSS-Time)(TZD)? HHMM-Time ::= Hours24 ":" Minutes HHMMSS-Time ::= Hours24 ":" Minutes ":" Seconds ("." Fraction)? Years ::= 4DIGIT; Months ::= 2DIGIT; range from 01 to 12 Days ::= 2DIGIT; range from 01 to 31 Hours24 ::= 2DIGIT; range from 00 to 23 4DIGIT ::= DIGIT DIGIT DIGIT DIGIT TZD ::= "Z" | (("+" | "-") Hours24 ":" Minutes )
Informative
Complete date plus hours and minutes: YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) Complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:30+01:00) Complete date plus hours, minutes, seconds and a decimal fraction of a second YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45+01:00)
Note that the Minutes, Seconds, Fraction, 2DIGIT and DIGIT syntax is as defined for Clock-values. Note that white space is not allowed within the date and time specification.
Normative
There are three ways of handling time zone offsets:
The presentation engine must be able to convert wallclock-values to a time within the document.
Informative
Note that the resulting begin or end time may be before the begin, or after end of the parent time container. This is not an error, but the time container constraints still apply. In any case, the semantics of the begin and end attribute govern the interpretation of the wallclock value.
The following examples all specify a begin at midnight on January 1st 2000, UTC
begin="wallclock(2000-01-01Z)" begin="wallclock( 2000-01-01T00:00Z )" begin="wallclock( 2000-01-01T00:00:00Z )" begin="wallclock( 2000-01-01T00:00:00.0Z )" begin="wallclock( 2000-01-01T00:00:00.0Z )" begin="wallclock( 2000-01-01T00:00:00.0-00:00 )"
The following example specifies a begin at 3:30 in the afternoon on July 28th 1990, in the Pacific US time zone:
begin="wallclock( 1990-07-28T15:30-08:00 )"
The following example specifies a begin at 8 in the morning wherever the document is presented:
begin="wallclock( 08:00 )"
Normative
The endsync attribute controls the simple duration of time containers, as a function of the children. The endsync attribute is only valid for par and excl time container elements, and media elements with timed children (e.g. animate or area elements). Integrating languages may allow the endsync attribute on any element with time container semantics. The endsync attribute is particularly useful with children that have "unknown" duration, e.g. an mpeg movie, that must be played through to determine the duration, or elements with event-based end timing.