SMIL 3.0 Timing and Synchronization

Author: W3C. Link to original: http://www.w3.org/TR/SMIL3/smil-timing.html (English).
Tags: smill, svg, XML Submitted by damirmanapov 10.04.2010. Public material.

Translations of this material:

into Russian: Перевод "SMIL 3.0 Timing and Synchronization". Translation is not started yet.
Submitted for translation by damirmanapov 10.04.2010

Text

5.1 Overview and Summary of Changes for SMIL 3.0

This section is informative.

The SMIL 3.0 specification leaves the basic syntax and semantics of the SMIL 2.1 timing model unchanged [SMIL21-timing]. The only change for SMIL 3.0 are that the four DOM method calls which were reserved in SMIL 2.1 have now been defined. A new module, DOMTimingMethods, was added which contains these DOM methods.

In addition to these changes, various typos were corrected and some clarifications were added.

5.2 Introduction

This section is informative

SMIL 1.0 solved fundamental media synchronization problems and defined a powerful way of choreographing multimedia content. SMIL 2.0 extends the timing and synchronization support, adding capabilities to the timing model and associated syntax. SMIL 3.0 adds Document Object Model support. 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 3.0 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.

SMIL 3.0 Timing and Synchronization support is broken down into 17 modules, allowing broad flexibility for language designers integrating this functionality. These modules are described in Appendix A: SMIL Timing and Synchronization modules.

5.3 Overview of SMIL timing

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:

The <seq> element plays the child elements one after another in&nbsp;a&nbsp;sequence.

The <excl> element plays one child at&nbsp;a&nbsp;time, but does not impose any order.

The <par> element plays child elements as&nbsp;a&nbsp;group (allowing &laquo;parallel&raquo; playback).

These elements are referred to&nbsp;as&nbsp;time containers. They group their contained children together into coordinated timelines.

SMIL Timing also provides attributes that may be&nbsp;used to&nbsp;specify an&nbsp;element&rsquo;s timing behavior. Elements have a&nbsp;begin, and a&nbsp;simple duration. The begin may be&nbsp;specified in&nbsp;various ways&nbsp;&mdash; for example, an&nbsp;element may begin at&nbsp;a&nbsp;given time, or&nbsp;based upon when another element begins, or&nbsp;when some event (such as&nbsp;a&nbsp;mouse click) happens. The simple duration defines the basic presentation duration of&nbsp;an&nbsp;element. Elements may be&nbsp;defined to&nbsp;repeat the simple duration, a&nbsp;number of&nbsp;times or&nbsp;for an&nbsp;amount of&nbsp;time. The simple duration and any effects of&nbsp;repeat are combined to&nbsp;define the active duration. When an&nbsp;element&rsquo;s active duration has ended, the element may either be&nbsp;removed from the presentation or&nbsp;frozen (held in&nbsp;its final state), e.g. to&nbsp;fill any gaps in&nbsp;the presentation.

An&nbsp;element becomes active when it&nbsp;begins its active duration, and becomes inactive when it&nbsp;ends its active duration. Within the active duration, the element is&nbsp;active, and outside the active duration, the element is&nbsp;inactive.

Figure 1&nbsp;illustrates the basic support of&nbsp;a&nbsp;repeating element within a&nbsp;simple <par> time container. The corresponding syntax is&nbsp;included with the diagram.

<par begin="0s" dur="33s">

<video begin="1s" dur="10s" repeatCount="2.5" fill="freeze" .../>

</par>

Figure 1&nbsp;&mdash; Strip diagram of&nbsp;basic timing support. The starred &laquo;Simple*&raquo; duration indicates that the simple duration is&nbsp;partial (i.e. it&nbsp;is&nbsp;cut off early).

The attributes that control these aspects of&nbsp;timing may be&nbsp;applied not only to&nbsp;media elements, but to&nbsp;the time containers as&nbsp;well. This allows, for example, an&nbsp;entire sequence to&nbsp;be&nbsp;repeated, and to&nbsp;be&nbsp;coordinated as&nbsp;a&nbsp;unit with other media and time containers. While authors may specify a&nbsp;particular simple duration for a&nbsp;time container, it&nbsp;is&nbsp;often easier to&nbsp;leave the duration unspecified, in&nbsp;which case the simple duration is&nbsp;defined by&nbsp;the contained child elements. When an&nbsp;element does not specify a&nbsp;simple duration, the time model defines an&nbsp;implicit simple duration for the element. For example, the implicit simple duration of&nbsp;a&nbsp;sequence is&nbsp;based upon the sum of&nbsp;the active durations of&nbsp;all the children.

Each time container also imposes certain defaults and constraints upon the contained children. For example in&nbsp;a <seq>, elements begin by&nbsp;default right after the previous element ends, and in&nbsp;all time containers, the active duration of&nbsp;child elements is&nbsp;constrained not to&nbsp;extend past the end of&nbsp;the time container&rsquo;s simple duration. Figure 2&nbsp;illustrates the effects of&nbsp;a&nbsp;repeating <par> time container as&nbsp;it&nbsp;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&nbsp;&mdash; Strip diagram of&nbsp;time container constraints upon child elements. The starred &laquo;Simple*&raquo; durations indicate that the simple duration is&nbsp;partial (i.e. it&nbsp;is&nbsp;cut off early).

The SMIL Timing Model defines how the time container elements and timing attributes are interpreted to&nbsp;construct a&nbsp;time graph. The time graph is&nbsp;a&nbsp;model of&nbsp;the presentation schedule and synchronization relationships. The time graph is&nbsp;a&nbsp;dynamic structure, changing to&nbsp;reflect the effect of&nbsp;user events, media delivery, and DOM control of&nbsp;the presentation. At&nbsp;any given instant, the time graph models the document at&nbsp;that instant, and the semantics described in&nbsp;this module. However, as&nbsp;user events or&nbsp;other factors cause changes to&nbsp;elements, the semantic rules are re-evaluated to&nbsp;yield an&nbsp;updated time graph.

When a&nbsp;begin or&nbsp;end value refers to&nbsp;an&nbsp;event, or&nbsp;to&nbsp;the begin or&nbsp;active end of&nbsp;another element, it&nbsp;may not be&nbsp;possible to&nbsp;calculate the time value. For example, if&nbsp;an&nbsp;element is&nbsp;defined to&nbsp;begin on&nbsp;some event, the begin time will not be&nbsp;known until the event happens. Begin and end values like this are described as&nbsp;unresolved. When such a&nbsp;time becomes known (i.e. when it&nbsp;can be&nbsp;calculated as&nbsp;a&nbsp;presentation time), the time is&nbsp;said to&nbsp;be&nbsp;resolved. A&nbsp;resolved time is&nbsp;said to&nbsp;be&nbsp;definite if&nbsp;it&nbsp;is&nbsp;not the value &laquo;indefinite&raquo;. See also the discussion of&nbsp;Unifying scheduled and interactive timing.

In&nbsp;an&nbsp;ideal environment, the presentation would perform precisely as&nbsp;specified. However, various real-world limitations (such as&nbsp;network delays) may influence the actual playback of&nbsp;media. How the presentation application adapts and manages the presentation in&nbsp;response to&nbsp;media playback problems is&nbsp;termed runtime synchronization behavior. SMIL includes attributes that allow the author to&nbsp;control the runtime synchronization behavior for a&nbsp;presentation.

5.4 Language definition

This section is&nbsp;normative

5.4.1 Changes for SMIL 3.0

This section is&nbsp;informative

This section remains largely unchanged for SMIL 3.0 except for the relaxation of&nbsp;the restrictions on&nbsp;the begin attributes of&nbsp;children of&nbsp;a&nbsp;seq time container. Also, a&nbsp;number of&nbsp;examples have been added.

5.4.2 Overview

This section is&nbsp;informative

The timing model is&nbsp;defined by&nbsp;building up&nbsp;from the simplest to&nbsp;the most complex concepts: first the basic timing and simple duration controls, followed by&nbsp;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&nbsp;host document is&nbsp;presented over a&nbsp;certain time interval.

5.4.3 Attributes

This section defines the set of&nbsp;timing attributes that are common to&nbsp;all of&nbsp;the SMIL synchronization elements.

Unless otherwise specified below, if&nbsp;there is&nbsp;any error in&nbsp;the argument value syntax for an&nbsp;attribute, the attribute will be&nbsp;ignored (as&nbsp;though it&nbsp;were not specified).

The begin and dur attributes: basic timing support

This section is&nbsp;informative

The basic timing for an&nbsp;element is&nbsp;described using the begin and dur attributes. Authors may specify the begin time of&nbsp;an&nbsp;element in&nbsp;a&nbsp;variety of&nbsp;ways, ranging from simple clock times to&nbsp;the time that an&nbsp;event (e.g. a&nbsp;mouse click) happens. The simple duration of&nbsp;an&nbsp;element is&nbsp;specified as&nbsp;a&nbsp;simple time value. The begin attribute syntax is&nbsp;described below.

The normative syntax rules for each attribute value variant are described in&nbsp;Timing attribute value grammars; an&nbsp;attribute value syntax summary is&nbsp;provided here as&nbsp;an&nbsp;aid to&nbsp;the reader.

begin : SMIL-1-syncbase-value&nbsp;| Begin-value-list

Defines when the element becomes active.

The attribute value is&nbsp;either a&nbsp;SMIL 1.0 syncbase declaration, or&nbsp;a&nbsp;semi-colon separated list of&nbsp;values.

SMIL-1-syncbase-value

Deprecated. Describes a&nbsp;syncbase and an&nbsp;offset from that syncbase. The element begin is&nbsp;defined relative to&nbsp;the begin or&nbsp;active end of&nbsp;another element.

Begin-value-list : Begin-value (&laquo;;&raquo; Begin-value-list )?

A&nbsp;semi-colon separated list of&nbsp;begin values. The interpretation of&nbsp;a&nbsp;list of&nbsp;begin times is&nbsp;detailed in&nbsp;the section Evaluation of&nbsp;begin and end time lists.

Begin-value : ( Offset-value&nbsp;| Syncbase-value&nbsp;| Event-value&nbsp;| Repeat-value&nbsp;| Accesskey-value&nbsp;| Media-Marker-value&nbsp;| Wallclock-sync-value&nbsp;| &laquo;indefinite&raquo; )

Describes the element begin.

Offset-value

Describes the element begin as&nbsp;an&nbsp;offset from an&nbsp;implicit syncbase. The definition of&nbsp;the implicit syncbase depends upon the element&rsquo;s parent time container. The offset is&nbsp;measured in&nbsp;parent simple time.

Syncbase-value

Describes a&nbsp;syncbase and an&nbsp;offset from that syncbase. The element begin is&nbsp;defined relative to&nbsp;the begin or&nbsp;active end of&nbsp;another element.

Event-value

Describes an&nbsp;event and an&nbsp;optional offset that determine the element begin. The element begin is&nbsp;defined relative to&nbsp;the time that the event is&nbsp;raised. Events may be&nbsp;any event defined for the host language in&nbsp;accordance with [DOM2Events]. These may include user-interface events, event-triggers transmitted via a&nbsp;network, etc. Details of&nbsp;event-based timing are described in&nbsp;the section below on&nbsp;Unifying Event-based and Scheduled Timing.

Repeat-value

Describes a&nbsp;qualified repeat event. The element begin is&nbsp;defined relative to&nbsp;the time that the repeat event is&nbsp;raised with the specified Iteration value.

Accesskey-value

Describes an&nbsp;accesskey that determines the element begin. The element begin is&nbsp;defined relative to&nbsp;the time that the accesskey character is&nbsp;input by&nbsp;the user.

Media-Marker-value

Describes the element begin as&nbsp;a&nbsp;named marker time defined by&nbsp;a&nbsp;media element.

Wallclock-sync-value

Describes the element begin as&nbsp;a&nbsp;real-world clock time. The wallclock time syntax is&nbsp;based upon syntax defined&nbsp;in [ISO8601].

&laquo;indefinite&raquo;

The begin of&nbsp;the element will be&nbsp;determined by&nbsp;a&nbsp;&laquo;beginElement()&raquo; method call or&nbsp;a&nbsp;hyperlink targeted to&nbsp;the element.

The SMIL Timing and Synchronization DOM methods are described in&nbsp;the DOMTimingMethods section.

Hyperlink-based timing is&nbsp;described in&nbsp;the Hyperlinks and timing section.

Begin value semantics

Children of&nbsp;a&nbsp;seq can only specify a&nbsp;non-negative offset value for begin.

If&nbsp;no&nbsp;begin is&nbsp;specified, the default timing is&nbsp;dependent upon the time container.

If&nbsp;there is&nbsp;a&nbsp;syntax error in&nbsp;any individual value in&nbsp;the list of&nbsp;begin or&nbsp;end values (i.e. the value does not conform to&nbsp;the defined syntax for any of&nbsp;the time values), the host language must specify how the user agent deals with this.

A&nbsp;time value may conform to&nbsp;the defined syntax but still be&nbsp;invalid (e.g. if&nbsp;an&nbsp;unknown element is&nbsp;referenced by&nbsp;ID in&nbsp;a&nbsp;syncbase value). If&nbsp;there is&nbsp;such an&nbsp;evaluation error in&nbsp;an&nbsp;individual value in&nbsp;the list of&nbsp;begin or&nbsp;end values, the individual value will be&nbsp;will be&nbsp;treated as&nbsp;though &laquo;indefinite&raquo; were specified, and the rest of&nbsp;the list will be&nbsp;processed normally. If&nbsp;no&nbsp;legal value is&nbsp;specified for a&nbsp;begin or&nbsp;end attribute, the element assumes an&nbsp;&laquo;indefinite&raquo; begin or&nbsp;end time (respectively).

The deprecated SMIL-1-syncbase-values are semantically equivalent to&nbsp;the following SMIL 3.0 Begin-value types:

id(Id-value)(begin) is&nbsp;equivalent to&nbsp;Id-value.begin

id(Id-value)(end) is&nbsp;equivalent to&nbsp;Id-value.end

id(Id-value)(Clock-value) is&nbsp;equivalent to&nbsp;Id-value.begin+ Clock-value

This section is&nbsp;informative

Children of&nbsp;a&nbsp;par begin by&nbsp;default when the par begins (equivalent to&nbsp;begin=&quot;0s&quot;). Children of&nbsp;a&nbsp;seq begin by&nbsp;default when the previous child ends its active duration (equivalent to&nbsp;begin=&quot;0s&laquo;); the first child begins by&nbsp;default when the parent seq begins. Children of&nbsp;an&nbsp;excl default to&nbsp;a&nbsp;begin value of&nbsp;&laquo;indefinite&raquo;.

The begin value may specify a&nbsp;list of&nbsp;times. This can be&nbsp;used to&nbsp;specify multiple &laquo;ways&raquo; or&nbsp;&laquo;rules&raquo; to&nbsp;begin an&nbsp;element, e.g. if&nbsp;any one of&nbsp;several events is&nbsp;raised. A&nbsp;list of&nbsp;times may also define multiple begin times, allowing the element to&nbsp;play more than once (this behavior can be&nbsp;controlled, e.g. to&nbsp;only allow the earliest begin to&nbsp;actually be&nbsp;used&nbsp;&mdash; see also the restart attribute).

In&nbsp;general, the earliest time in&nbsp;the list determines the begin time of&nbsp;the element. There are additional constraints upon the evaluation of&nbsp;the begin time list, detailed in&nbsp;Evaluation of&nbsp;begin and end time lists.

Note that while it&nbsp;is&nbsp;legal to&nbsp;include &laquo;indefinite&raquo; in&nbsp;a&nbsp;list of&nbsp;values for begin, &laquo;indefinite&raquo; is&nbsp;only really useful as&nbsp;a&nbsp;single value. Combining it&nbsp;with other values does not impact begin timing, as&nbsp;DOM begin methods may be&nbsp;called with or&nbsp;without specifying &laquo;indefinite&raquo; for begin.

When a&nbsp;begin time is&nbsp;specified as&nbsp;a&nbsp;syncbase variant, a&nbsp;marker value or&nbsp;a&nbsp;wallclock value, the defined time must be&nbsp;converted by&nbsp;the implementation to&nbsp;a&nbsp;time that is&nbsp;relative to&nbsp;the parent time container (i.e. to&nbsp;the equivalent of&nbsp;an&nbsp;offset value). This is&nbsp;known as&nbsp;timespace conversion, and is&nbsp;detailed in&nbsp;the section Converting between local and global times.

Handling negative offsets for begin

For children of <par> and <excl> time containers, the computed offset relative to&nbsp;the parent begin time may be&nbsp;negative.

A&nbsp;begin time may be&nbsp;specified with a&nbsp;negative offset relative to&nbsp;an&nbsp;event or&nbsp;to&nbsp;a&nbsp;syncbase that is&nbsp;not initially resolved. When the syncbase or&nbsp;eventbase time is&nbsp;resolved, the computed time may be&nbsp;in&nbsp;the past.

The computed begin time defines the scheduled synchronization relationship of&nbsp;the element, even if&nbsp;it&nbsp;is&nbsp;not possible to&nbsp;begin the element at&nbsp;the computed time. The time model uses the computed begin time, and not the observed time of&nbsp;the element begin.

This section is&nbsp;informative

The use of&nbsp;negative offsets to&nbsp;define begin times merely defines the synchronization relationship of&nbsp;the element. It&nbsp;does not in&nbsp;any way override the time container constraints upon the element, and it&nbsp;cannot override the constraints of&nbsp;presentation time.

If&nbsp;an&nbsp;element has a&nbsp;begin time that resolves to&nbsp;a&nbsp;time before the parent time container begins, the parent time container constraint still applies. For example:

<par>

Pages: ← previous Ctrl next