This document is also available in a non-normative format. single HTML file.
Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document specifies the third version of the Synchronized Multimedia Integration Language (SMIL, pronounced "smile"). SMIL 3.0 has the following design goals:
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is a W3C Proposed Recommendation (PR) of the Synchronized Multimedia
Integration Language (SMIL) 3.0.
This document is based upon the SMIL 3.0 Candidate
Recommendation published on 15 January 2008. The current document
contains editorial improvements, and minor bug fixes. The significant changes
in this draft are available in the changeslog.
W3C Advisory Committee Members are invited to send formal review comments
to the W3C Team until 06 November 2008. Review comments should be sent to symm-review@w3.org; comments sent there
will be made available to members after the review period ends. People
wanting their comments visible to members sooner, or to be archived publicly,
can send a cc to the ac-forum@w3.org
list or to www-archive@w3.org as
appropriate. The public is invited to send comments to the public mailing
list www-smil@w3.org [archives],
including the prefix'[SMIL30 PR]' in the subject line.
After the review the Director will announce the document's disposition. This
announcement should be expected no sooner than 14 days after the end of the
review.
Feedback received during that review resulted in clarifications but no major changes. The SYMM Working Group believes that this specification addresses all Candidate Recommendation issues. Evidence of interoperability between at least two implementations of this specification are documented in the Implementation Report.
The SMIL 3.0 test suite along with an implementation report are publicly released and are intended solely to be used as proof of SMIL 3.0 implementability. It is only a snapshot of the actual implementation behaviors at one moment of time, as these implementations may not be immediately available to the public. The interoperability data is not intended to be used for assessing or grading the performance of any individual implementation.
This document has been produced by the SYMM Working Group as part of the W3C Synchronized Multimedia Activity, following the procedures set out for the W3C Process. The goals of the SYMM Working Group are discussed in the SYMM Working Group Charter. The authors of this document are the SYMM Working Group members. Different parts of the document have different editors.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Publication as a Proposed Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This section is informative.
This document specifies the third version of the Synchronized Multimedia Integration Language (SMIL, pronounced "smile"). SMIL 3.0 has the following design goals:
SMIL 3.0 is defined as a set of markup modules, which define the semantics and an XML syntax for certain areas of SMIL functionality.
This section is informative.
This specification is structured as a set of Chapters, each defining one or more modules:
This specification also defines five Profiles that are built using the above SMIL 3.0 modules.
This section is informative.
SMIL 3.0 is a new version. It is built on top of SMIL 2.1.
A large number of SMIL 2.1 Modules [SMIL21-modules] remain the same in SMIL
3.0.
SMIL 3.0 introduces new SMIL 3.0 Modules with extended functionalities.
SMIL 3.0 also defines three new profiles that are built using the SMIL 3.0 modules specified in this specification.
If this specification is approved as a W3C Recommendation, it will supersede the 13 December 2005 version of the SMIL 2.1 Recommendation [SMIL21].
Note: SMIL document players, those applications that support playback of "application/smil+xml" documents, and host language conformant document profiles must support the deprecated SMIL 2.1 functionalities as well as the new SMIL 3.0 functionalities.
This section is informative.
SMIL 3.0 specification provides three classes of changes to the SMIL 2.1 Recommendation, among the functional areas. For more details on the SMIL 3.0 Modules changes, refer to the next SMIL 3.0 Modules chapter.
1- New SMIL 3.0 functional areas
SMIL 3.0 adds the following new sections introducing new modules where new elements or attributes semantics are specified.
2- Revised SMIL 3.0 functional areas
In these sections, updated or new modules are introduced where new and updated elements or attributes semantics are specified.
3- Unchanged SMIL 3.0 functional areas
The modules, elements and attributes semantics in the following sections remain the same as in SMIL2.1 [SMIL21]. There are no major changes to the document; apart from minor issues related to wording, typos, links and references.
1- New SMIL 3.0 Profiles:
SMIL3.0 adds the following three new Profiles:
2- Updated SMIL 3.0 Profiles:
The following Profiles are updated from SMIL 2.1 [SMIL21] to include new SMIL 3.0 functionalities.
Finally, SMIL 3.0 provides a Scalability Framework, where a family of scalable SMIL profiles may be defined using a sub- or superset of the SMIL 3.0 Language, DAISY, or Unified Mobile Profile profiles, or a superset of the SMIL 3.0 Tiny profile.
This section is informative.
Throughout the document, normative and informative sections are labelled with following rules:
- a <div> section associated with a class="normative or
class="informative". These two class have different styling to ease
viewing of different sections.
- a statement "This section is normative" or "This section
is informative" which follows the <div> tag
Informative sections are color coded as follows. All other sections (without a gray background and green border) are normative.
This section is informative.
This section is normative.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document are to be interpreted as described in [[RFC2119[].
For readability, these words do not appear in all uppercase letters in this specification.
This section is informative.
This document has been prepared by the Synchronized Multimedia Working
Group (SYMM WG) of the World Wide Web Consortium.
The SYMM WG which specified SMIL 3.0 included the following individuals:
The former SYMM WG which specified the previous SMIL versions included the following individuals:
This section is informative.
The following are the changes done in this document, since the previous SMIL 3.0 CR version.
This section is informative.
Since the publication of SMIL 1.0 [SMIL10], interest in the integration of SMIL concepts with the HTML, the HyperText Markup Language [HTML4], and other XML languages, has grown. Likewise, the W3C HTML Working Group has specified XHTML, the Extensible HyperText Markup Language [XHTML10], in preparation to subset, extend, and integrate it with other languages. The strategy considered for integrating respective functionality with other XML-based languages is based on the concepts of modularization and profiling [SMIL-MOD], [XMOD].
Modularization is an approach in which markup functionality is specified as a set of modules that contain semantically-related XML elements, attributes, and attribute values. Profiling is the creation of an XML-based language through combining these modules, in order to provide the functionality required by a particular application.
Profiling introduces the ability to tailor an XML-based language to specific needs, e.g. to optimize presentation and interaction for the client's capabilities. Profiling also adds the ability for integrating functionality from other markup languages, releasing the language designer from specifying that functionality. Moreover, it provides for consistency in markup through the use of the same model to incorporate a function. Identical constructs ease authoring, while at the user agent side there is a potential for re-use of code. For example, a scheduler supporting SMIL timing and synchronization functionality could be used for SMIL documents, XHTML+SMIL documents, and SVG documents.
Modularization enables language designers to specify dedicated markup intended for integration with other, existing, profiles. Examples of specifications intended for such integration are MathML and XForms [MathML], [XFORMS10].
Modularization and profiling use the extensibility properties of XML, and related technology like XML namespaces and XML Schema [XML11], [XML-NS], [XSCHEMA].
This part of the SMIL 3.0 specification describes the framework on which SMIL modularization and profiling is based, and specifies the SMIL 3.0 Modules, their identifiers, and the requirements for conformance within this framework.
This section is informative.
The modularization approach used in this specification derives from that set forth in XHTML Modularization [XMOD]. The framework on which SMIL modularization and profiling is based, is informally described here.
A Module is a collection of semantically-related XML elements, attributes, and attribute values that represents a unit of functionality. Modules are defined in coherent sets.
A Profile is a combination of modules. Modules are atomic, i.e. they may not be subset when included in a profile. Furthermore, a module specification may include a set of integration requirements, to which profiles that include the module must comply.
Commonly, there is a main profile that incorporates nearly all the modules associated with a single namespace. For this version of SMIL, this is the SMIL 3.0 Language profile.
Other profiles may be specified that are subsets of the larger one, or that incorporate a mixture of modules associated with different namespaces. SMIL 3.0 Tiny is an example of the first, XHTML+SMIL of the latter.
Several of SMIL's modules define features that that characterize the core of the functionality provided by SMIL. This is expressed by the notions of host language and integration set. Both of them relate to a set of conformance requirements for language profiles, which includes the requirement to incorporate at least the core set of modules. The set may be different for a host language and an integration set. A host language must incorporate the Structure module; an integration set need not. There may be other differences as well.
The main purpose of profile conformance is to enhance interoperability. Preferably, the mandatory modules for host language conformance are defined in such a way that any document interchanged in a conforming profile will yield a reasonable presentation when the document renderer, while supporting the associated mandatory module set, would ignore all other (unknown) elements and attributes. Here, "reasonable presentation" is to be understood as something intelligible, which is not necessarily a close reflection of the author's original intentions. To achieve the latter, a negotiation would have to be conducted to agree on the specific profile to be used for the document interchange.
This section is informative.
SMIL 3.0 specification provides three classes of changes to the SMIL 2.1 Recommendation, among the functional areas;
The following functional areas are affected by SMIL 3.0:
DOM
Content Control
This functional area is currently unchanged, apart from repartitioning of the content control module structure in order to support the SMIL Tiny profile. In a future version the content control mechanisms specified will be modified to better align with the expression and test logic being developed within the SMIL 3.0 State modules.Layout
SMIL 3.0 extends the Layout capabilities as follows:
Linking
SMIL 3.0 linking integrates the general features of the XHTML-2 access and role attributes as an extension and replacement for the accessKey attribute. This is expected to result in the deprecation or removal of the accesskey attribute and the accesskey event from the SMIL 2.1 language.
Media Object
SmilText
This new smilText functionality provides a new media type for use in SMIL presentations. The smilText modules provide a text container element with an explicit content model for defining in-line text, and a set of additional elements and attributes to control explicit in-line text rendering.
The following 3 modules are introduced in the new Text functional area allowing use of in-line text content:
In addition, SMIL 3.0 also defines the smilText profile, which allows timed text markup to be placed in a light-weight external container.
Metainformation
Metainformation mechanisms in SMIL 3.0 provide a general purpose approach to attaching metainformation to any element within the presentation.
Structure
The new Identity module identifies the SMIL version and the SMIL profile. This replaces the former SMIL approach of defining separate namespaces for individual modules and profiles.
Timing
The SMIL 3.0 specification leaves the basic syntax and semantics of the SMIL 2.1 timing model [SMIL21-timing] unchanged apart from the following changes:
State
The new modules in this section provide a mechanism whereby the document author may create more complex controlflow than what SMIL provides through the timing and content control modules, without having to go all the way of using a scripting language. One way to provide this is to allow a document to have some explicit state (think: variables) along with ways to modify, use and save this state.
The following 4 modules are introduced in the State functional areas:
This section is normative.
SMIL functionality is partitioned into 12 functional areas. Within each functional area a further partitioning is applied into modules. All of these modules, and only these modules, are associated with the SMIL namespace.
The functional areas and their corresponding modules are:
Note: Modules marked with (**) are new Modules added in SMIL 3.0. Modules marked with (*) are revised modules from SMIL 2.1.
Each of these modules introduces a set of semantically-related elements, properties, and attributes. Each functional area has a corresponding section in this specification document. Further details on each of the modules is specified within those sections.
The modules may be independent or complementary. For example, the SyncMaster module requires and builds upon the SyncBehavior module, but the PrefetchControl and SkipContentControl modules are independent from each other. In addition, some modules require modules from other functional areas.
Modules specify their integration requirements. When one module requires another module for basic features and as a prerequisite for integration, a profile must include the second module in order to include the first. The first module is said to be a dependent of the second module. Dependency may be nested, in that a module may be dependent on a module that is a dependent itself.
Table 1 presents the SMIL 3.0 modules and the modules they depend on.
| Module | Dependencies |
| AccessKeyTiming | NONE |
| AlignmentLayout | BasicLayout |
| AudioLayout | BasicLayout |
| BackgroundTilingLayout | BasicLayout |
| BasicAnimation | BasicInlineTiming |
| BasicContentControl | NONE |
| BasicInlineTiming | NONE |
| BasicExclTimeContainers | NONE |
| BasicLayout | StructureLayout |
| BasicLinking | NONE |
| BasicMedia | NONE |
| BasicPriorityClassContainers | BasicExclTimeContiners |
| BasicText | NONE |
| BasicTimeContainers | NONE |
| BasicTransitions | NONE |
| BrushMedia | NONE |
| CustomTestAttributes | BasicContentControl |
| DOMTimingMethods | NONE |
| EventTiming | NONE |
| FillDefault | BasicTimeContainers, and/or BasicExclTimeContainers, BasicPriorityClassContainers, and/or TimeContainerAttributes |
| FullScreenTransitionEffects | BasicTransitions |
| Identity | NONE |
| InlineTransitions | NONE |
| LinkingAttributes | NONE |
| MediaAccessibility | MediaDescription |
| MediaClipMarkers | MediaClipping |
| MediaClipping | BasicMedia |
| MediaDescription | NONE |
| MediaMarkerTiming | NONE |
| MediaOpacity | BasicMedia |
| MediaPanZoom | BasicMedia |
| MediaParam | BasicMedia |
| MediaRenderAtrributes | NONE |
| MetaInformation | NONE |
| MinMaxTiming | NONE |
| MultiArcTiming | AccessKeyTiming, and/or BasicInlineTiming, and/or EventTiming,
and/or MediaMarkerTiming, and/or RepeatValueTiming, and/or SyncbaseTiming, and/or WallclockTiming |
| MultiWindowLayout | BasicLayout |
| ObjectLinking | BasicLinking |
| OverrideLayout | BasicLayout, SubRegionLayout |
| PrefetchControl | NONE |
| RepeatTiming | NONE |
| RepeatValueTiming | NONE |
| RequiredContentControl | NONE |
| RestartDefault | RestartTiming |
| RestartTiming | NONE |
| SkipContentControl | NONE |
| SplineAnimation | BasicAnimation |
| StateInterpolation | NONE |
| StateSubmission | UserState |
| StateTest | NONE |
| Structure | BasicContentControl, and BasicInlineTiming, and BasicLayout, and BasicLinking, and BasicMedia, and BasicTimeContainers, and SkipContentControl, and SyncbaseTiming |
| StructureLayout | Structure |
| SubRegionLayout | BasicLayout |
| SyncbaseTiming | NONE |
| SyncBehavior | BasicTimeContainers, and/or BasicExclTimeContainers, BasicPriorityClassContainers, and/or TimeContainerAttributes |
| SyncBehaviorDefault | SyncBehavior |
| SyncMaster | SyncBehavior |
| TextMotion | BasicText |
| TextStyling | BasicText |
| TimeContainerAttributes | NONE |
| TimeManipulations | NONE |
| TransitionModifiers | BasicTransitions, and/or InlineTransitions |
| UserState | NONE |
| WallclockTiming | NONE |
This section is normative.
This section specifies the identifiers for the SMIL 3.0 MIME Type and the SMIL 3.0 modules. The identifiers for SMIL 3.0 profiles are defined as part of the profile specification.
Documents authored in host-language conformant profiles may be associated
with the "application/smil+xml" mime type:
"application/smil+xml" mime type are required to be host
language conformant. The "application/smil" mime type as
specified in SMIL 2.0 [SMIL20] is obsolete.
Each module in this specification has a unique identifier associated with it. They are intended to uniquely and consistently identify each of them. They should be used as values in a test for whether an implementation includes a specific module, as well as in other circumstances where a need to refer to a specific SMIL 3.0 module is necessary. These identifiers are to be used with the systemRequired attribute from the RequiredContentControl module.
Table 2 summarizes the identifiers for SMIL 3.0 modules.
| Module name | Identifier |
| AccessKeyTiming | http://www.w3.org/2008/SMIL30/AccessKeyTiming |
| AudioLayout | http://www.w3.org/2008/SMIL30/AudioLayout |
| BackgroundTilingLayout | http://www.w3.org/2008/SMIL30/BackgroundTilingLayout |
| AlignmentLayout | http://www.w3.org/2008/SMIL30/AlignmentLayout |
| BasicAnimation | http://www.w3.org/2008/SMIL30/BasicAnimation |
| BasicContentControl | http://www.w3.org/2008/SMIL30/BasicContentControl |
| BasicInlineTiming | http://www.w3.org/2008/SMIL30/BasicInlineTiming |
| BasicExclTimeContainers | http://www.w3.org/2008/SMIL30/BasicExclTimeContainers |
| BasicLayout | http://www.w3.org/2008/SMIL30/BasicLayout |
| BasicLinking | http://www.w3.org/2008/SMIL30/BasicLinking |
| BasicMedia | http://www.w3.org/2008/SMIL30/BasicMedia |
| BasicPriorityClassContainers | http://www.w3.org/2008/SMIL30/BasicPriorityClassContainers |
| BasicText | http://www.w3.org/2008/SMIL30/BasicText |
| BasicTimeContainers | http://www.w3.org/2008/SMIL30/BasicTimeContainers |
| BasicTransitions | http://www.w3.org/2008/SMIL30/BasicTransitions |
| BrushMedia | http://www.w3.org/2008/SMIL30/BrushMedia |
| CustomTestAttributes | http://www.w3.org/2008/SMIL30/CustomTestAttributes |
| DOMTimingMethods | http://www.w3.org/2008/SMIL30/DOMTimingMethods |
| EventTiming | http://www.w3.org/2008/SMIL30/EventTiming |
| FillDefault | http://www.w3.org/2008/SMIL30/FillDefault |
| FullScreenTransitionEffects | http://www.w3.org/2008/SMIL30/FullScreenTransitionEffects |
| Identity | http://www.w3.org/2008/SMIL30/Identity |
| InlineTransitions | http://www.w3.org/2008/SMIL30/InlineTransitions |
| LinkingAttributes | http://www.w3.org/2008/SMIL30/LinkingAttributes |
| MediaAccessibility | http://www.w3.org/2008/SMIL30/MediaAccessibility |
| MediaClipMarkers | http://www.w3.org/2008/SMIL30/MediaClipMarkers |
| MediaClipping | http://www.w3.org/2008/SMIL30/MediaClipping |
| MediaDescription | http://www.w3.org/2008/SMIL30/MediaDescription |
| MediaMarkerTiming | http://www.w3.org/2008/SMIL30/MediaMarkerTiming |
| MediaOpacity | http://www.w3.org/2008/SMIL30/MediaOpacity |
| MediaPanZoom | http://www.w3.org/2008/SMIL30/MediaPanZoom |
| MediaParam | http://www.w3.org/2008/SMIL30/MediaParam |
| MediaRenderAttributes | http://www.w3.org/2008/SMIL30/MediaRenderAttributes |
| Metainformation | http://www.w3.org/2008/SMIL30/Metainformation |
| MinMaxTiming | http://www.w3.org/2008/SMIL30/MinMaxTiming |
| MultiArcTiming | http://www.w3.org/2008/SMIL30/MultiArcTiming |
| MultiWindowLayout | http://www.w3.org/2008/SMIL30/MultiWindowLayout |
| ObjectLinking | http://www.w3.org/2008/SMIL30/ObjectLinking |
| OverrideLayout | http://www.w3.org/2008/SMIL30/OverrideLayout |
| PrefetchControl | http://www.w3.org/2008/SMIL30/PrefetchControl |
| RepeatTiming | http://www.w3.org/2008/SMIL30/RepeatTiming |
| RepeatValueTiming | http://www.w3.org/2008/SMIL30/RepeatValueTiming |
| RequiredContentControl | http://www.w3.org/2008/SMIL30/RequiredContentControl |
| RestartDefault | http://www.w3.org/2008/SMIL30/RestartDefault |
| RestartTiming | http://www.w3.org/2008/SMIL30/RestartTiming |
| SkipContentControl | http://www.w3.org/2008/SMIL30/SkipContentControl |
| SplineAnimation | http://www.w3.org/2008/SMIL30/SplineAnimation |
| StateTest | http://www.w3.org/2008/SMIL30/StateTest |
| StateInterpolation | http://www.w3.org/2008/SMIL30/StateInterpolation |
| StateSubmission | http://www.w3.org/2008/SMIL30/StateSubmission |
| Structure | http://www.w3.org/2008/SMIL30/Structure |
| StructureLayout | http://www.w3.org/2008/SMIL30/StructureLayout |
| SubRegionLayout | http://www.w3.org/2008/SMIL30/SubRegionLayout |
| SyncbaseTiming | http://www.w3.org/2008/SMIL30/SyncbaseTiming |
| SyncBehavior | http://www.w3.org/2008/SMIL30/SyncBehavior |
| SyncBehaviorDefault | http://www.w3.org/2008/SMIL30/SyncBehaviorDefault |
| SyncMaster | http://www.w3.org/2008/SMIL30/SyncMaster |
| TextMotion | http://www.w3.org/2008/SMIL30/TextMotion |
| TextStyling | http://www.w3.org/2008/SMIL30/TextStyling |
| TimeContainerAttributes | http://www.w3.org/2008/SMIL30/TimeContainerAttributes |
| TimeManipulations | http://www.w3.org/2008/SMIL30/TimeManipulations |
| TransitionModifiers | http://www.w3.org/2008/SMIL30/TransitionModifiers |
| UserState | http://www.w3.org/2008/SMIL30/UserState |
| WallclockTiming | http://www.w3.org/2008/SMIL30/WallclockTiming |
In addition to the module identifiers above, there are different sets of features that may be expressed using the following identifiers:
http://www.w3.org/2008/SMIL30/NestedTimeContainershttp://www.w3.org/2008/SMIL30/SMIL20DeprecatedFeatureshttp://www.w3.org/2008/SMIL30/SMIL10DeprecatedFeaturesModules may also be identified collectively. When grouped into SMIL 3.0 profiles, the module identification string is placed in the profile specification. Profiles will also provide an identification string for their DTD specification. In addition, the following general module collections are defined:
http://www.w3.org/2008/SMIL30/http://www.w3.org/2008/SMIL30/HostLanguagehttp://www.w3.org/2008/SMIL30/IntegrationSetImplementations must allow these as identifiers for use with the systemRequired attribute from the RequiredContentControl module.
Profiles must identify those attributes for which an implementation must return "true" (this is an integration requirement). Implementations must return "false" for modules or features which are not fully supported.
This section is normative.
The rules for host-language and SMIL 3.0 document conformance, as well as the rules for SMIL 3.0 User Agent conformance are provided as part of the SMIL Scalability Framework.
This section is informative.
This section describes how profiles could be defined using the SMIL 3.0 modular DTDs. The reader is assumed to be familiar with the mechanisms defined in "Modularization of XHTML" [XMOD], in particular Appendix D [XMOD-APPD] and Appendix E [XMOD-APPE]. In general, the SMIL 3.0 modular DTDs use the same mechanisms as the XHTML modular DTDs use. Exceptions to this are:
Below, we give a short description of the files that are used to define the SMIL 3.0 modular DTDs. See the table and the end of the section for a complete list of the filenames involved.
Following the same mechanisms as the XHTML modular DTDs, the SMIL 3.0 specification places the XML element declarations (e.g. <!ELEMENT...>) and attribute list declarations (e.g. <!ATTLIST...>) of all SMIL 3.0 elements in separate files, the SMIL module files. A SMIL module file is provided for each functional area in the SMIL 3.0 specification (that is, there is a SMIL module file for animation, layout, timing, etc).
The SMIL module files are used in the normative definitions of the specification of the SMIL 3.0 Language profile. Usage of the same module files for defining other SMIL profiles is recommended, but not required. The requirements that SMIL profiles must follow are stated in the SMIL 3.0 specification, not in the DTD code.
To make the SMIL module files independent of each other, and independent of the profiles, the element and attribute declarations make heavy use of XML entities. This provides profiles with the necessary hooks to define the actual content models and attributes of the SMIL elements.
The SMIL 3.0 Language profile provides examples of how the SMIL module files may be used. Most of the DTD files are reused across the different profiles. Reused are the SMIL module files, the files that define the data types and the common attributes, the "qname" file that takes care of adding namespace prefixes if necessary, and the framework file, which takes care of including files in the appropriate order.
The file that is different for each profile is the driver file, and possibly the document model file. To define a new profile, one has to write the extension module(s), the driver file that defines which modules are used, and a document model file that defines the extended document model. A new profile that merely reuses SMIL 3.0 modules may not need a new document model file. The driver file and document model file are described in more detail below.
The driver file.
This is the file that would be referenced by a document's DOCTYPE declaration. Its main job is to define the modules and features that are included in the DTD. The file contains the following parts.
If the SMIL element names are to be prefixed, this can be done by adding something like the following to the start of the profile:
<!ENTITY % SMIL.prefixed "INCLUDE" >
<!ENTITY % SMIL.prefix "foobar" >
Elements defined in their modules as, for example, <video> will become parsed as <foobar:video>. This also applies for SMIL attributes that appear on other elements, so, for example, "begin" becomes "foobar:begin". The default is that the qname prefix is empty -- that is, it is effectively turned off by default.
The default value of the baseProfile should be defined. If not
defined, the value defaults to #IMPLIED. For example:
<!ENTITY % SMIL.baseProfile.default "#FIXED 'Language'">
The modules to be included in the DTD need to be specified using entity definitions such as this, one for each included module:
<!ENTITY % SMIL.Structure.module "INCLUDE" >
The entity names are all of the form
SMIL.ModuleName.module. The default for all modules is
that they are not included.
For each of the optional features and variants that are to be
included, an entity needs to be defined as "INCLUDE".
Here is a list of all possible entities:
SMIL.animation-targetElementSMIL.animation-XLinkTargetSMIL.transition-targetElementSMIL.transition-XLinkTargetSMIL.ITS-Attributes.moduleSMIL.RoleAttributes.moduleSMIL.submission-postSMIL.ContentControl.deprecated.moduleSMIL.MediaClipping.deprecated.moduleSMIL.RepeatTiming.deprecated.moduleSMIL.BasicLinking.deprecated.moduleSMIL.TextExternal.moduleThe default for these optional features is that they are not included.
The document model file that is to be used needs to be defined:
<!ENTITY % smil-model.mod
PUBLIC "-//W3C//ENTITIES SMIL 3.0 Document Model 1.0//EN"
"smil-profile-model-1.mod" >
All standard SMIL DTDs use the same document model file.
The framework file needs to be included. The framework file will subsequently include the data type, common attributes, qname and document model file.
The SMIL module files that are used by this profile need to be included.
The document model file.
The document model file contains the XML entities that are used by the SMIL module files to define the content models and attribute lists of the elements in that profile.
Content models generally differ from profile to profile, or contain elements from other modules. To avoid these dependencies in the SMIL module files, content models may be defined in the document model file. The (dummy) default content model as defined in the SMIL module files is "EMPTY" for all SMIL 3.0 elements.
For the same reasons, the SMIL module files only define a default attribute list for their elements. This default list only contains the SMIL 3.0 core attributes and the attributes that are defined in the same SMIL module file. All other attributes may be added to this default list by defining the appropriate XML entities. For example, the Media Objects Module file only adds the core and media related attributes on the media objects; other attributes, such as the timing attributes, are added to this list by the document model file.
| Driver files for the predefined profiles | |
| -//W3C//DTD SMIL 3.0 Language//EN | http://www.w3.org/2008/SMIL30/SMIL30Language.dtd |
| -//W3C//DTD SMIL 3.0 Unified Mobile//EN | http://www.w3.org/2008/SMIL30/SMIL30UnifiedMobile.dtd |
| -//W3C//DTD SMIL 3.0 Daisy//EN | http://www.w3.org/2008/SMIL30/SMIL30Daisy.dtd |
| -//W3C//DTD SMIL 3.0 Tiny//EN | http://www.w3.org/2008/SMIL30/SMIL30Tiny.dtd |
| -//W3C//DTD SMIL 3.0 smilText//EN | http://www.w3.org/2008/SMIL30/SMIL30smilText.dtd |
| Document model files for the predefined profiles | |
| -//W3C//ENTITIES SMIL 3.0 Document Model 1.0//EN | http://www.w3.org/2008/SMIL30/smil-profile-model-1.mod |
| SMIL 3.0 module files | |
| -//W3C//ELEMENTS SMIL 3.0 Animation//EN | http://www.w3.org/2008/SMIL30/SMIL-anim.mod |
| -//W3C//ELEMENTS SMIL 3.0 Content Control//EN | http://www.w3.org/2008/SMIL30/SMIL-control.mod |
| -//W3C//ELEMENTS SMIL 3.0 Layout//EN | http://www.w3.org/2008/SMIL30/SMIL-layout.mod |
| -//W3C//ELEMENTS SMIL 3.0 Linking//EN | http://www.w3.org/2008/SMIL30/SMIL-link.mod |
| -//W3C//ELEMENTS SMIL 3.0 Media Objects//EN | http://www.w3.org/2008/SMIL30/SMIL-media.mod |
| -//W3C//ELEMENTS SMIL 3.0 Document Metainformation//EN | http://www.w3.org/2008/SMIL30/SMIL-metainformation.mod |
| -//W3C//ELEMENTS SMIL 3.0 SMILtext//EN | http://www.w3.org/2008/SMIL30/SMIL-smiltext.mod |
| -//W3C//ELEMENTS SMIL 3.0 State//EN | http://www.w3.org/2008/SMIL30/SMIL-state.mod |
| -//W3C//ELEMENTS SMIL 3.0 Document Structure//EN | http://www.w3.org/2008/SMIL30/SMIL-struct.mod |
| -//W3C//ELEMENTS SMIL 3.0 Timesheet//EN | http://www.w3.org/2008/SMIL30/SMIL-timesheet.mod |
| -//W3C//ELEMENTS SMIL 3.0 Timing//EN | http://www.w3.org/2008/SMIL30/SMIL-timing.mod |
| -//W3C//ELEMENTS SMIL 3.0 Transition//EN | http://www.w3.org/2008/SMIL30/SMIL-transition.mod |
| Other utilities: data types, common attributes, qname and frame work files | |
| -//W3C//ENTITIES SMIL 3.0 Common Attributes 1.0//EN | http://www.w3.org/2008/SMIL30/smil-attribs-1.mod |
| -//W3C//ENTITIES SMIL 3.0 Datatypes 1.0//EN | http://www.w3.org/2008/SMIL30/smil-datatypes-1.mod |
| -//W3C//ENTITIES SMIL 3.0 Modular Framework 1.0//EN | http://www.w3.org/2008/SMIL30/smil-framework-1.mod |
| -//W3C//ENTITIES SMIL 3.0 Qualified Names 1.0//EN | http://www.w3.org/2008/SMIL30/smil-qname-1.mod |
This section is informative.
The SMIL 3.0 specification adds the Identity Module to the SMIL 2.1 Structure Module [SMIL21-structure]. It also adds the xml:id attribute, which should be used to assign identity to elements instead of the id attribute, which has been deprecated in SMIL 3.0.
This section is informative
This Section defines the SMIL Structure module and the Identity Module.
The Structure module provides
the base elements for structuring SMIL content. These elements act as the
root in the content model of all SMIL Host
Language conformant language profiles. The Structure module is a
mandatory module for SMIL Host Language conformant language profiles. The
SMIL Structure module is composed of the smil, head, and body elements, and is compatible with SMIL
1.0 [SMIL10]. The corresponding SMIL 1.0
elements form a subset of the Structure module, both in syntax and semantics,
as their attributes and content model is also exposed by the Structure
module. Thus, the Structure module is backwards compatible with SMIL 1.0.
The Identity Module provides attributes to identify the SMIL version and the SMIL profile.
This section is normative
This section defines the elements and attributes that make up the SMIL 3.0 Structure module.
The smil element acts as the root element for all SMIL Host Language conformant language profiles.
The smil element may have the following attributes:
The smil element may contain the following elements:
The head element contains information that is not related to the temporal behavior of the presentation. Three types of information may be contained by head. These are meta information, layout information, and author-defined content control.
The head element may have the following attributes:
The head element contains elements depending on the other modules and specific syntax included in the language profile integrating this module.
The body element contains information that is related to the temporal and linking behavior of the document. It acts as the root element of the timing tree.
The body element has the timing semantics of a time container equal to that of the seq element [BasicTimeContainers module]. Note, that in other language profiles, where a body element from another (Structure) Module is in use, that body element may have different timing semantics. For example, in the XHTML+SMIL language profile (still in progress and not yet a W3C Recommendation), the body element comes from HTML, and acts as a par time container.
The body element may have the following attributes:
The timing attributes defined in the various SMIL 3.0 Timing modules are part of the body element so far as the corresponding timing modules, such as BasicInlineTiming, are part of the language profile. When a timing module is included in a language profile, the features of that module should be supported on the body element just as they are supported on the other elements in the profile. For example, the syncMaster attribute should be supported on the body element if the SyncMaster module is included in the integrating profile.
The body element contains elements depending on the other modules and specific syntax included in the language profile integrating this module.
This section is normative
When this module is included in a language profile, the xml:id, class, and title attributes defined in this module must be included on all elements from all modules used in the profile, including those from other module families and of non-SMIL origin. The integrating profile should also consider adding the xml:lang attribute to the applicable elements.
The SMIL Structure module is the starting module when building any SMIL Host Language conformant language profile. The Structure module may not be used for building other, non-SMIL Host Language conformant language profiles. This implies that the SMIL Structure module must at least be accompanied with the other modules mandatory for SMIL Host language conformance, and the elements in the structure module must include at least the minimum content models required for SMIL Host language conformance.
When modules from outside the SMIL 3.0 namespace are integrated in the language profile, it must be specified how the elements from those non-SMIL modules fit into the content model of the used SMIL modules (and vice versa). For example, with respect to the SMIL Structure module, the Profiling Entities in the DTD should be overridden. This creates a so-called hybrid document type [XMOD]. In case of a so-called compound document type, the rules of XML namespaces must be satisfied [XML-NS].
This section is normative
This module contains two attributes, version and baseProfile, which are used to identify which version of SMIL and for which Profile the document is written for.
The Identity Module does not contain any element definitions.
This section defines the attributes that make up the SMIL 3.0 Identity
Module.
version-number ::= "3.0"profile-name ::= "Language" | "UnifiedMobile" | "Daisy" | "Tiny"
| "smilText" | user-defined-profile-name
user-defined-profile-name ::= "x-" NMTOKENThis section is informative
Example of version and baseProfile attribute use
<smil xml:id="root" xmlns="http://www.w3.org/ns/SMIL" version="3.0" baseProfile="Tiny" > <head xml:id="head"> ... </head> <body xml:id="body"> ... </body> </smil>
It is the responsibility of the language profile to specify which elements support the version and baseProfile attributes. All profiles should at least support these two attributes on the top-level smil element.
This section is informative.
There are three major changes to the Media Object modules for SMIL 3.0: the first is the splitting of the SMIL 2.1 MediaParam module into two modules: the MediaParam and MediaRenderAttributes modules; the second is the introduction of the MediaOpacity module, containing new rendering attributes for chroma key and opacity control; the third is the introduction of the MediaPanZoom module. The rationale for these changes is:
The MediaParam module also includes new text that explicitly discusses the behavior of adding the various media control attributes defined in that section to a SMIL layout region definition as a means of providing a global mechanism for applying default attribute settings to all content rendered within that region.
A number of editorial changes have also been integrated into the various Media Object modules descriptions; these do not impact the functionality defined in earlier versions of SMIL.
This section is informative.
This section defines the SMIL media object modules, which are composed of the BasicMedia module and nine modules with additional functionality that build on top of the BasicMedia module: the BrushMedia, MediaClipping, MediaClipMarkers, MediaParam, MediaRenderAttributes, MediaOpacity, MediaAccessibility, MediaDescription, and MediaPanZoom modules. These modules contain elements and attributes used to reference external media objects or control media object rendering behavior. Since these elements and attributes are defined in a series of modules, designers of other markup languages may reuse the SMIL media module when they wish to include media objects into their language.
The differences between current media object functionality and that provided by the SMIL 1.0 specification are explained in Appendix A.
This section is normative.
This section provides convenience definitions for common timing and resource identifier terms used in this module.
SMIL provides a number of timing-related concepts that are used to determine activation, duration and termination of media objects in a presentation. The temporal semantics of these concepts are discussed in the SMIL 3.0 Timing and Synchronization module.
The distinction between continuous and discrete media is sometimes arbitrary and may be SMIL renderer dependent. For example, animated images that do not have a well-defined duration (simply a repeating collection of frames) are classified for SMIL scheduling purposes as being discrete media; such objects have an intrinsic scheduling duration of zero seconds.
In this specification, the term URI [URI] refers to a universal resource identifier, as defined in [RFC3986] and subsequently extended under the name IRI in [RFC3987]. In some cases, the term URI has been retained in the specification to avoid using new names for concepts such as "Base URI" that are defined or referenced across a whole family of XML specifications.
This section is normative.
This module defines the baseline media functionality of a SMIL player.
SMIL defines a single generic media object element that allows the inclusion of external media objects into a SMIL presentation. Media objects are included by reference (using a IRI).
In addition to the ref element, SMIL allows the use of the following set of synonyms:
All of these media elements are semantically identical. When playing back an external media object, the player must not derive the exact type of the media object from the name of the media object element. Instead, it must rely solely on other sources about the type, such as the type information communicated by a server or the operating system, or by using type information contained in the type attribute.
This section is informative.
Authors are encouraged to use meaningful synonyms (animation, audio, img, video, text or textstream) when referencing external media objects. This is in order to increase the readability of the SMIL document. Some SMIL implementations may require the use of an element type that matches the information type of the object. When in doubt about the group of a media object, authors should use the generic "ref" element.
The animation element defined here should not be confused with the elements defined in the SMIL 3.0 Animation Module. The animation element defined in this module is used to include an external animation object file (such as a vector graphics animation) by reference. This is in contrast to the elements defined in the Animation module, which provide an in-line syntax for the animation of attributes and properties of other elements.
SMIL 3.0 also supports the smilText element for defining in-line timed text content. This functionality is described in the smilText Modules specification.
Anchors and links may be attached to visual media objects, i.e. media objects rendered on a visual abstract rendering surface.
Languages implementing the SMIL BasicMedia Module must define which attributes may be attached to media object elements. In all languages implementing the SMIL BasicMedia module, media object elements may have the following attributes:
The attribute supports fragment identifiers and the '#' connector in the IRI value. The fragment part is an id value that identifies one of the elements within the referenced media item. With this construct, SMIL 3.0 supports locators as currently used in HTML (that is, it uses locators of the form http://www.example.org/some/path#anchor1), with the difference that the values are of unique identifiers and not the values of "name" attributes. Generally speaking, this type of addressing implies that the target media is of a structured type that supports the concept of id, such as HTML or XML-based languages.
Note that this attribute is not required. A media object with no src attribute has an intrinsic duration of zero, and participates in timing just as any other media element. No media will be fetched by the SMIL implementation for a media element without a src attribute.
When the content represented by a URL is available in many data formats, implementations MAY use the type value to influence which of the multiple formats is used. For instance, on a server implementing HTTP content negotiation, the client may use the type attribute to order the preferences in the negotiation. The type attribute is not intended for use in media sub-stream selection.
For protocols not enumerated in this specification, implementations should use the following rules: When the media is encapsulated in a media file and delivered intact to the SMIL user agent via a protocol designed for delivery as a complete file, the media type as provided by this protocol should take precedence over the type attribute value. For protocols which deliver the media in a media-aware fashion, such as those delivering media in a manner using or dependent upon the specific type of media, the application of the type attribute is not defined by this specification.
Element Content
Languages utilizing the SMIL BasicMedia module must define the complete set of elements which may act as children of media object elements. There are currently no required children of a media object defined in the BasicMedia Module, but languages utilizing the BasicMedia module may impose requirements beyond this specification.
If the including profile supports the XMLBase functionality [XMLBase] , the values of the src and longdesc attributes on the media object elements must be interpreted in the context of the relevant XMLBase URI prefix.
User-agent implementations are responsible for defining the rendering
behavior when fragment addressing is used in the src attribute. Such definition should be added
to language profiles that wish to include specific media addressing features.
For example:
- User-agents should define the default behavior for when referencing a
non-existing id in the target media document.
- User-agents should define the rendering method for the selected media
fragment: in context, with or without highlighting and scrolling, or
stand-alone (selective rendering only).
- User-agents should describe the timing implication for when addressing
timed-content.
SMIL 3.0 allows but does not require user agents to be able to process XPointer values in the IRI value of the src attribute. The SMIL 3.0 Linking Module provides additional information related to XPointer.
This section is normative.
This section defines the elements and attributes that make up the SMIL MediaParam Module definition. The MediaParam module is intended to provide a uniform mechanism for media object initialization. Languages implementing elements and attributes found in the MediaParam module must implement all elements and attributes defined below, as well as BasicMedia.
The param element allows a general parameter value to be sent to a media object renderer as a name/value pair. This parameter is sent to the renderer at the time that the media object is processed by the scheduler. It is up to the media renderer to associate an action with the given param. The media renderer may choose to ignore any unknown or inappropriate param values (such as sending a font size to an audio object).
Any number of param elements may appear (in any order) in the content of a media object element or in a paramGroup element. If a given parameter is defined multiple times, the lexically last version of that parameter value should be used.
The syntax of names and values is assumed to be understood by the object's implementation. The SMIL specification does not specify how user agents should retrieve name/value pairs.
Example
This section is informative.
To illustrate the use of param, suppose that we have a facial animation plug-in that is able to accept different moods and accessories associated with characters. These could be defined in the following way:<ref src="http://www.example.com/herbert.face"> <param name="mood" value="surly" valuetype="data"/> <param name="accessories" value="baseball-cap,nose-ring" valuetype="data"/> </ref>
The paramGroup element provides a convenience mechanism for defining a collection of media parameters that may be reused with several different media objects. If present, the paramGroup element must appear in the head section of the document. The content of the paramGroup element consists of zero or more param elements. The paramGroup element may not contain nested paramGroup element definitions.
Element attributes
This element does not define any new attributes. Profiles integrating this element must specify an attribute of type ID [XML11] by which the param group is referenced in a media object reference. For SMIL 3.0, the xml:id attribute will typically be used.
Examples
This section is informative.
This section contains several fragments that illustrate uses of the paramGroup element.
In the following fragment, a paramGroup is created to define parameters that are passed to several different media objects:
<smil ... >
<head>
...
<paramGroup xml:id="clown">
<param name="mood" value="upBeat" valuetype="data"/>
<param name="accessories" value="flowers,dunceCap"/>
</paramGroup>
...
</head>
<body>
...
<ref src="http://www.example.com/andy.face" paramGroup="clown"/>
...
<ref src="http://www.example.com/sally.face" paramGroup="clown"/>
...
</body>
</smil>
In the following example, a media object provides an additional param value:
<smil ... >
<head>
...
<paramGroup xml:id="clown">
<param name="mood" value="upBeat" valuetype="data"/>
<param name="accessories" value="flowers,dunceCap"/>
</paramGroup>
...
</head>
<body>
...
<ref src="http://www.example.com/andy.face" paramGroup="clown">
<param name="gender" value="male"/>
</ref>
...
</body>
</smil>
In this final example, a media object provides a duplicate param value. The behavior in this case depends on the media renderer; all param values are passed to the renderer in the lexical order of the SMIL source file. It is expected that the lexically last value for any parameter sent to the renderer be used, if possible.
<smil ... >
<head>
...
<paramGroup xml:id="clown">
<param name="mood" value="upBeat" valuetype="data"/>
<param name="accessories" value="flowers,dunceCap"/>
</paramGroup>
...
</head>
<body>
...
<ref src="http://www.example.com/andy.face" paramGroup="clown">
<param name="gender" value="male"/>
<param name="mood" value="depressed" valuetype="data"/>
</ref>
...
</body>
</smil>
In addition to the element attributes defined in BasicMedia, media object elements and layout regions may add the media initialization attribute defined below.
Any profile that integrates the functionality of this module is strongly encouraged to define a set of common parameter names that may be used to initialize common media object types for that profile. This can significantly increase interoperability of user agents and media rendering libraries.
The supported uses of the type and valuetype attributes on the param element must be specified by the integrating profile. If a profile does not specify this, the type and valuetype attributes will be ignored in that profile.
This section is normative.
This section defines the elements and attributes that make up the SMIL MediaRenderAttributes Module definition. Languages implementing elements and attributes found in the MediaRenderAttributes module must implement all elements and attributes defined below, as well as BasicMedia.
This module does not define any elements.
In addition to the element attributes defined in BasicMedia, media object elements and layout regions may have the attributes and attribute extensions defined below.
Values:
Example:
This section is informative.
<par>
<seq>
<par>
<img src="image1.jpg" region="foo1" fill="freeze" erase="never" .../>
<audio src="audio1.au"/>
</par>
<par>
<img src="image2.jpg" region="foo2" fill="freeze" erase="never" .../>
<audio src="audio2.au"/>
</par>
...
<par>
<img src="imageN.jpg" region="fooN" fill="freeze" erase="never" .../>
<audio src="audioN.au"/>
</par>
</seq>
</par>
In this example, each image is successively displayed and remains displayed until the end of the presentation.
Values:
As an example of how this would be used, many animated GIFs intrinsically repeat indefinitely. The application of mediaRepeat= "strip" allows an author to remove the intrinsic repeat behavior of an animated GIF on a per-reference basis, causing the animation to display only once, regardless of the repeat value embedded in the GIF.
When mediaRepeat is used in conjunction with SMIL Timing Module attributes, this attribute is applied first, so that the repeat behavior can then be controlled with the SMIL Timing Module attributes such as repeatCount and repeatDur.
Values:
Any profile that supports the erase attribute must define what is meant by "display area" and further define the interaction. See the definition of erase for more details.
This section is normative.
This section defines the elements and attributes that make up the SMIL MediaOpacity Module definition. Languages implementing elements and attributes found in the MediaOpacity module must implement all elements and attributes defined below, as well as BasicMedia.
This module does not define any elements.
In addition to the element attributes defined in BasicMedia, media object elements and layout regions may have the attributes and attribute extensions defined below.
This section is informative.
The attributes in this module allow the opacity (that is, the degree to which a media object is transparent) to be defined. Opacity may be controlled in several ways, depending on the type of media being used. For unstructured media (that is, media that does not contain an explicitly-defined background color), the chromaKey attribute may be used to identify a particular color that will serve as the background color for purposes of opacity manipulation. If a chromaKey is used, the chromaKeyOpacity attribute may specify the degree of transparency desired. Since the color used to define a background may not be exactly preserved within a media object, the chromaKeyTolerance attribute allows a tolerance range to be defined for the chroma key color.
Some media objects, such as RealText, smilText, GIF, PNG, and Flash, define an explicit background color. In these cases, the specification of the opacity of that color can be done using the mediaBackgroundOpacity attribute. In these cases, only the defined color is manipulated.
In addition to specifying the transparency level of a particular background color, SMIL also allows the specification of the transparency level of a total media object. This is accomplished using the mediaOpacity attribute.
Note that SMIL layout also defines the backgroundOpacity attribute to control the transparency of a layout region.
This module does not introduce any special integration constraints.
This section is normative.
This section defines the attributes that make up the SMIL MediaClipping Module definition. Languages implementing the attributes found in the MediaClipping module must implement the attributes defined below, as well as BasicMedia.
Clip-value-MediaClipping ::= [ Metric "=" ] ( Clock-val | Smpte-val )
Metric ::= Smpte-type | "npt"
Smpte-type ::= "smpte" | "smpte-30-drop" | "smpte-25"
Smpte-val ::= Hours ":" Minutes ":" Seconds
[ ":" Frames [ "." Subframes ]]
Hours ::= DIGIT+
Minutes ::= DIGIT DIGIT /* range from 00 to 59 */
Seconds ::= DIGIT DIGIT /* range from 00 to 59 */
Frames ::= DIGIT DIGIT /* smpte range = 00-29, smpte-30-drop range = 00-29, smpte-25 range = 00-24 */
Subframes ::= DIGIT DIGIT /* smpte range = 00-01, smpte-30-drop range = 00-01, smpte-25 range = 00-01 */
DIGIT ::= [0-9]
The value of this attribute consists of a metric specifier, followed by a time value whose syntax and semantics depend on the metric specifier. The following formats are allowed:
The time value has the format
hours:minutes:seconds:frames.subframes. If the subframe value is
zero, it may be omitted. Subframes are measured in one-hundredths
of a frame.
Examples:
clipBegin="smpte=10:12:33"
This section is informative.
The introduction of subframe notation in SMIL 2.1 introduced an inconsistency with SMIL 1.0. As of this draft, SMIL 3.0 has deprecated the subframe notation.
clipBegin="npt=123.45s"
clipBegin="npt=12:05:35.3"If no metric specifier is given, then a default of "npt=" is presumed.
When used in conjunction with the timing attributes from the SMIL Timing Module, this attribute is applied before any SMIL Timing Module attributes.
clipBegin may also be expressed as clip-begin for compatibility with SMIL 1.0. Software supporting the SMIL 2.1 Language Profile must be able to handle both clipBegin and clip-begin, whereas software supporting only the SMIL MediaClipping module only needs to support clipBegin. If an element contains both a clipBegin and a clip-begin attribute, then clipBegin takes precedence over clip-begin.
Example:
This section is informative.
<audio src="radio.wav" clip-begin="5s" clipBegin="10s" />
The clip begins at second 10 of the audio, and not at second 5, since the clip-begin attribute is ignored. A strict SMIL 1.0 implementation will start the clip at second 5 of the audio, since the clipBegin attribute will not be recognized by that implementation. See Changes to SMIL 1.0 Media Object Attributes for more discussion on this topic.
See Changes to SMIL 1.0 Media Object Attributes for more discussion on this topic.
This section is normative.
This section defines the attribute extensions that make up the SMIL MediaClipMarkers Module definition. Languages implementing elements and attributes found in the MediaClipMarkers module must implement all elements and attributes defined below, as well as BasicMedia and MediaClipping.
Clip-value-MediaClipMarkers ::= Clip-value-MediaClipping |
"marker" "=" URI-reference
/* "URI-reference" is defined in [URI] */
Example: Assume that a recorded radio transmission consists of a sequence of songs, which are separated by announcements by a disk jockey. The audio format supports marked time points, and the begin of each song or announcement with number X is marked as songX or djX respectively. To extract the first song using the "marker" metric, the following audio media element may be used:
<audio clipBegin="marker=#song1" clipEnd="marker=#dj1" />
This section is normative.
This section defines the elements and attributes that make up the SMIL BrushMedia Module definition. Languages implementing elements and attributes found in the BrushMedia module must implement all elements and attributes defined below.
The brush element is a lightweight media object element which allows an author to paint a solid color in place of a media object. Attributes associated with media objects may also be applied to brush element. (A specific profile will determine the attribute set applied to this element.)
Profiles including the BrushMedia module must provide semantics for using a color attribute value of inherit on the brush element. Because inherit doesn't make sense in all contexts, the value of inherit is prohibited on the color attribute of the brush element for profiles that do not otherwise define these semantics.
This section is normative.
This section defines the elements and attributes that make up the SMIL MediaAccessibility Module definition. Languages implementing elements and attributes found in the MediaAccessibility module must implement all elements and attributes defined below, as well as MediaDescription.
It is strongly recommended that all media object elements have an "alt" attribute with a brief, meaningful description. Authoring tools should ensure that no element may be introduced into a SMIL document without this attribute.
The value of this attribute is a CDATA text string.
Elements that contain alt, title or longdesc attributes are read by the assistive technology according to the following rules:
Example
This section is informative.
<par>
<video xml:id="carvideo" src="car.rm" region="videoregion" title="Car video"
alt="Illustration of relativistic time dilation and length
contraction."
longdesc="carvideodesc.html" readIndex="3"/>
<audio xml:id="caraudio" src="caraudio.rm" region="videoregion"
title="Car presentation voiceover" begin="bar.begin"/>
<animation xml:id="cardiagram" src="car.svg" region="animregion"
title="Diagram of the car" readIndex="2"/>
<img xml:id="scvad" src="scv.png" region="videoregion"
title="Advertisement for Sugar Coated Vegetables"
readIndex="1"/>
</par>
In this example, an assistive device that is presenting titles should present the "scvad" element title first (having the lowest readIndex value of "1"), followed by the "cardiagram" title, followed by the "carvideo" element title, and finally present the "caraudio" element title (having an implicit readIndex value of "0").
Note that not all examples in this specification use all media accessibility attributes because the purpose of the sample code is to illustrate specific language features.
This section is normative.
This section defines the elements and attributes that make up the SMIL MediaDescription Module definition. Languages implementing elements and attributes found in the MediaDescription module must implement all elements and attributes defined below.
This attribute is deprecated in favor of using appropriate SMIL metadata markup in RDF. For example, this attribute maps well to the "description" attribute as defined by the Dublin Core Metadata Initiative [DC] .
The value of this attribute is a CDATA text string.
The value of this attribute is a CDATA text string.
xml:lang differs from the systemLanguage test attribute in one important respect. xml:lang provides information about the content's language independent of what implementations do with the information, whereas systemLanguage is a test attribute with specific associated behavior (see systemLanguage in SMIL Content Control Module for details)
This section is informative.
SMIL 3.0 also supports the use of the element within the MetaInformation Module to supply additional or alternative forms of metainformation for any media object.
This section is normative.
This section is informative.
The SMIL MediaPanZoom module integrates the functionality of the SVG viewBox attribute and adapts it for use within the SMIL media framework. The SMIL panZoom attribute allows a SMIL author to define a two-dimensional extent over the visible surface of a media object and to subsequently project the contents within the panZoom area into a SMIL presentation.
Most of SMIL's layout elements and attributes provide the ability to define and manage a two-dimensional rendering space. This space is defined relative to a root-layout (or topLayout) specification. All of the coordinate and size specifications are in terms of the coordinate space defined for the layout root. In contrast, the panZoom attribute allows users to define an area in terms of the coordinate space used by the media object that is associated with the panZoom area. The panZoom area may be smaller, equal to, or larger than the related media object.
The following illustration shows three views of a 300x200 pixel image. In the left view, a panZoom area is shown that is the same size as the media object; in the middle view, a panZoom area is defined that covers the middle part of the image only; in the right view, a panZoom area is illustrated that is positioned (in both dimensions) partially outside the media object. Note that while this illustration shows the panZoom area projected onto an image, similar illustrations could be defined for videos or text objects, or any other object that may be mapped to a particular media bounding box.

Once a portion of a media object's visible area is defined with a panZoom area, the portion within the panZoom area is processed further as if it defined the full native view of the media object. The content within the panZoom area is projected into a region in a manner that is dependent on the region element associated with that object, including any scaling dictated by the fit attribute or (if appropriate), sub-region positioning and alignment directives.
If the region and the panZoom area have the same aspect ratios, then the panZoom area will, by default, fill the entire region. If the effective pixel dimensions of the region are larger than that of the panZoom area, the effect will be an enlargement of the media content. If the effective pixel dimensions of the window are smaller than that of the panZoom area, the effect will be a reduction in size of the media object. Other effects may be obtained by manipulating the fit attribute of the region.
If supported by the profile implementing this module, a dynamic pan-and-zoom effect may be obtained by applying standard SMIL animation primitives to the dimensions of the panZoom area. A pan effect may be obtained by varying the X and Y positioning values, and a zoom effect may be obtained by changing the size dimensions of the panZoom area. Examples of these effects are given later in this module description. Given the nature of independently animating collections of attribute values, care should be taken when specifying animation behavior.
If a panZoom area extends past the viewable extents of a media object (such as in the rightmost illustration, above), then the effective contents of these extended areas will be transparent.
This module does not define any new elements. It provides extensions to the ref element (and its synonyms), and to the region element.
The panZoom attribute is added to media object references.
The panZoom area is processed on the media object before any other SMIL layout processing occurs. The actual visual rendering of the content resulting from the processed panZoom area will be determined by, among other factors: the size of the target region, the application of sub-region positioning in that region (if supported by the profile), the value of the fit attribute on the region, and the effect of SMIL alignment attributes (if supported by the profile).
This section is informative.
If the profile integrating the panZoom element allows each of the attribute values to be animated, care should be taken to choose an animation calculation mode that will yield predictable results (such as using a linear mode). The animation of mixed percentage/pixel values for height and width is not recommended.
Note that the specification of negative values for left and top is not an error; this allows placing (a portion of) the panZoom area outside of the media.
The SMIL MediaPanZoom module does not extend the content model for the ref element integrating these attributes.
The panZoom attribute is added to regions definitions.
The SMIL MediaPanZoom module does not extend the content model for the region element integrating these attributes.
This section is informative.
Assume the following SMIL example:
<smil ...>
<head>
...
<layout>
<root-layout height="200" width="300" backgroundColor="red" />
<region xml:id="I" top="0" left="0" height="200" width="300" backgroundColor="blue" />
</layout>
</head>
<body>
<seq>
<ref xml:id="R1" src="table.jpg" panZoom="0,0,300,200" dur="5s" region="I" />
<ref xml:id="R2" src="table.jpg" panZoom="80,50,160,125" dur="5s" region="I" fit="meet"/>
<ref xml:id="R3" src="table.jpg" panZoom="80,50,160,125" dur="5s" region="I" fit="meetBest"/>
<ref xml:id="R4" src="table.jpg" panZoom="240,120,85,110" dur="5s" region="I" fit="meet"/>
</seq>
</body>
</smil>
In this example, a single region is defined that is used to display four instances of the same image. Each media reference within the sequence S contains a different panZoom area definition, each of which will result in the following behavior:
Note that the origin of the sub-image defined by the panZoom area is placed at the origin of the top-left of the region. Note also that the value of the fit attribute determines that the image is scaled (while maintaining the aspect ratio), resulting in the zoom effect.
All of the previous examples illustrate how a panZoom area operates on a media object that contains a media-defined viewable extent. The panZoom attribute may also be applied to visual objects that do not have predefined extents. Consider the following example, in which an unstructured text object is placed in a region:
<smil ...>
<head>
...
<layout>
<root-layout height="200" width="300" backgroundColor="red" />
<region xml:id="T" top="0" left="0" height="50" width="300" backgroundColor="blue" />
</layout>
</head>
<body>
<seq>
<ref xml:id="R0" src="short_story.txt" panZoom="0,10,50,200" dur="10s" region="T" />
</seq>
</body>
</smil>
In this example, a single region is defined that is used to display a undimensioned text object. In SMIL 3.0, the text object would first be rendered to an off-screen bitmap based on the default settings for the media object (font, font size, font color) and then a panZoom area of the defined size would be overlaid on this text representation. This facility is especially useful when combined with SMIL Animation, as discussed in the next example.
The ability to define a panZoom area, when combined with SMIL animation primitives, provides a simple mechanism for doing pan/zoom animations over a visual object. (These pan/zoom animations are often called 'Ken Burns' animations.) The following example illustrates how a pan window may be positioned and moved over an image area:
<smil ...>
<head>
...
<layout>
<root-layout height="200" width="300" backgroundColor="red" />
<region xml:id="B" top="0" left="0" height="50" width="75" backgroundColor="blue" />
</layout>
</head>
<body>
<seq>
<ref xml:id="R0" src="table_233x150.jpg" panZoom="0,0,50,75" dur="20s" region="B" fit="meet" >
<animate attributeName="panZoom"
values="25,20,50,75; 45,55,50,75; 140,40,50,75; 35,0,100,150; 0,0,100,150"
dur="20s" />
</ref>
...
</seq>
</body>
</smil>
In this example, an image with intrinsic size of 233x150 pixels is rendered into a region of size 50x75. An initial panZoom area is defined that displays a 50x75 portion of that image, positioned in its top-left corner. During the following 20 seconds, the panZoom area is moved across the image according to the behavior of the animate element; the panZoom area changes are scheduled at equal points across the animation timeline (in this case, every 5 seconds). During the final animation, the panZoom area is extended to implement a zoom-out across the entire image. An illustration of the rendering results is shown below:
This module does not define any SMIL events.
The MediaPanZoom module allows individual media object references to override the default values for certain attributes. In all cases, the attributes will apply only to the (sub-)region referenced by the media object. Changes will not propagate to child sub-regions or to parent regions.
The functionality in this module builds on top of the functionality in the Media module, which is a required prerequisite for inclusion of the MediaPanZoom module.
The functionality in this module builds on the viewBox definition of SVG. Unlike SVG, the SMIL panZoom attribute defines a logical sub-image that contains only content within the panZoom area; SVG uses the viewBox to define a minimum viewing dimension for content, but allowing content outside the viewBox to be displayed in the region.
The MediaPanZoom module does not define a preserveAspectRatio attribute, since this functionality is already provided by the SMIL fit and registration/alignment attributes.
See the full DTD for the SMIL Layout modules.
This section is informative.
With regards to the clipBegin/clip-begin and clipEnd/clip-end elements, SMIL 3.0 defines the following changes to the syntax defined in SMIL 1.0:
Using attribute names with hyphens such as clip-begin and clip-end is problematic when using a scripting language and the DOM to manipulate these attributes. Therefore, this specification adds the attribute names clipBegin and clipEnd as an equivalent alternative to the SMIL 1.0 clip-begin and clip-end attributes. The attribute names with hyphens are deprecated.
Authors may use two approaches for writing SMIL 3.0 presentations that use the new clipping syntax and functionality ("marker", default metric) defined in this specification, but can still can be handled by SMIL 1.0 software. First, authors may use non-hyphenated versions of the new attributes that use the new functionality, and add SMIL 1.0 conformant clipping attributes later in the text.
Example:
<audio src="radio.wav" clipBegin="marker=song1" clipEnd="marker=moderator1"
clip-begin="npt=0s" clip-end="npt=3:50" />
SMIL 1.0 players implementing the recommended extensibility rules of SMIL 1.0 [SMIL10] will ignore the clip attributes using the new functionality, since they are not part of SMIL 1.0. SMIL 3.0 players, in contrast, will ignore the clip attributes using SMIL 1.0 syntax, because the SMIL 3.0 syntax takes precedence over the SMIL 1.0 syntax.
The second approach is to use the following steps:
Example:
<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" baseProfile="Language"> ... <switch> <audio src="radio.wav" clipBegin="marker=song1" clipEnd="marker=moderator1" system-required="smil2" /> <audio src="radio.wav" clip-begin="npt=0s" clip-end="npt=3:50" /> </switch>
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.
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.
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 may be used to specify an element's timing behavior. Elements have a begin, and a simple duration. The begin may be specified in various ways - for example, an element may 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 may 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 may either be removed from the presentation or frozen (held in its final state), e.g. to fill any gaps in the presentation.
An element becomes active when it begins its active duration, and becomes inactive when it ends its active duration. Within the active duration, the element is active, and outside the active duration, the element is inactive.
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 may 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 may 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.
When a begin or end value refers to an event, or to the begin or active end of another element, it may not be possible to calculate the time value. For example, if an element is defined to begin on some event, the begin time will not be known until the event happens. Begin and end values like this are described as unresolved. When such a time becomes known (i.e. when it can be calculated as a presentation time), the time is said to be resolved. A resolved time is said to be definite if it is not the value "indefinite". See also the discussion of Unifying scheduled and interactive timing.
In an ideal environment, the presentation would perform precisely as specified. However, various real-world limitations (such as network delays) may 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.
This section is normative
This section is informative
This section remains largely unchanged for SMIL 3.0 except for the relaxation of the restrictions on the begin attributes of children of a seq time container. Also, a number of examples have been added.
This section is 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.
Unless otherwise specified below, if there is any error in the argument value syntax for an attribute, the attribute will be ignored (as though it were not specified).
This section is informative
The basic timing for an element is described using the begin and dur attributes. Authors may 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 in Timing attribute value grammars; an attribute value syntax summary is provided here as an aid to the reader.
id(Id-value)(begin) is equivalent to
Id-value.beginid(Id-value)(end) is equivalent to
Id-value.endid(Id-value)(Clock-value) is equivalent
to Id-value.begin+ Clock-valueThis section is informative
Children of a par begin by default
when the par begins (equivalent to
begin="0s"). Children of a seq begin by default when the previous child
ends its active duration (equivalent to begin="0s"); the first
child begins by default when the parent seq begins. Children of an excl default to a begin value of "indefinite".
The begin value may 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 may 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 begin timing, as DOM begin methods may 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 known as timespace conversion, and is detailed in the section Converting between local and global times.
The computed begin time defines the scheduled synchronization relationship of the element, even if it is not possible to begin the element at the computed time. The time model uses the computed begin time, and not the observed time of the element begin.
This section is 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.
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 xml: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).
This section is informative
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 element will actually begin at the time computed according to the following algorithm:
Let o be the offset value of a given begin value, d be the associated simple duration, AD be the associated active duration. Let rAt be the time when the begin time becomes resolved. Let rTo be the resolved sync-base or event-base time without the offset Let rD be rTo - rAt. If rD < 0 then rD is set to 0. If AD is indefinite, it compares greater than any value of o or ABS(o). REM( x, y ) is defined as x - (y * floor( x/y )). If y is indefinite or unresolved, REM( x, y ) is just x. Let mb = REM( ABS(o), d ) - rD
If ABS(o) >= AD then the element does not begin. Else if mb >= 0 then the media begins at mb. Else the media begins at mb + d.
If the element repeats, the Iteration value of the repeat
event has the calculated value based upon the above computed begin time, and
not the observed number of repeats.
This section is informative
Thus for example:
<smil ...> ... <ref begin="foo.activateEvent-8s" dur="3s" repeatCount="10" .../> ... </smil>
The element begins when the user activates (for example, clicks on) the
element "foo". Its calculated begin time is actually 8 seconds earlier, and
so it begins to play at 2 seconds into the 3 second simple duration, on the
third repeat iteration. One second later, the fourth iteration of the element
will begin, and the associated repeat event will have the
Iteration value set to 3 (since it is zero based). The element will end 22
seconds after the activation. The beginEvent event is raised
when the element begins, but has a time stamp value that corresponds to the
defined begin time, 8 seconds earlier. Any time dependents are activated
relative to the computed begin time, and not the observed begin time.
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.
This section is informative
A begin time 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.
Note that an element cannot actually begin until the parent time container begins. An element with a negative time delay behaves as if it had begun earlier.
The presentation effect for the element (e.g. the display of visual media) is equivalent to that for 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, the element presentation effect of a negative begin offset is equivalent to a clipBegin specification with the same magnitude as the offset value. Nevertheless, the timing side effects are not equivalent to a clipBegin value as described. Time dependents of the begin value will behave as though the element had begun earlier.
The length of the simple duration is specified using the dur attribute. The dur attribute syntax is described below.
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 "media" attribute value is used on an element that
does not define media (e.g. on the SMIL 3.0 time container elements par, seq
and excl), the attribute will be
ignored (as though it were not specified). Contained media such as the
children of a par are not considered
media directly associated with the element.
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.
This section is informative
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 timed children, it is described as a simple media element.
This comment is informative.
Note that clipBegin and clipEnd attributes on a media element may override the intrinsic media duration, and will define the implicit duration. See also the Media Object module.This comment is informative.
For par, seq and excl time containers, and media elements that are also time containers, the implicit simple duration is a function of the type of the time container and of its endsync attribute. For details see the section Time container durations.
If the author specifies a value for dur that is shorter than the implicit duration for an element, the implicit duration will be cut short by the specified simple duration.
If the author specifies a simple duration that is longer than the implicit duration for an element, the implicit duration of the element is extended to the specified simple duration:
This section is informative
Note that when the simple duration is "indefinite", some simple use cases can yield surprising results. See the related example #4 in Appendix B.
This section is informative
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 xml:id="song1" src="song1.au" /> <img src="img1.jpg" begin="song1.begin+2s" /> </par>
Elements may 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.
<smil ...> ... <text xml:id="show" ... /> <img begin="show.activateEvent" dur="3.5s" ... /> ... </smil>
SMIL 3.0 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, a syncbase, 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.
endElement() method call.This section is informative
If an end attribute is specified but none of dur, repeatCount and repeatDur are specified, the simple duration is defined to be indefinite, and the end value constrains this to define the active duration. The behavior of the simple duration in this case is defined in Dur value semantics, as though dur had been specified as "indefinite".
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.
The deprecated SMIL-1-syncbase-values are semantically equivalent to the following SMIL 3.0 End-value types:
id(Id-value)(begin) is equivalent to
Id-value.beginid(Id-value)(end) is equivalent to
Id-value.endid(Id-value)(Clock-value) is equivalent to
Id-value.begin+Clock-valueThis section is informative
The end value may 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 may also define multiple end times that may 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 duration. 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" .../>
If an author wishes to specify the implicit duration as well as an end
constraint, the dur attribute may be
specified as "media". In the following example, the element will
end at the earlier of the intrinsic media duration, or a mouse click:
<smil ...> ... <video dur="media" end="activateEvent" src="movie.mpg" .../> ... </smil>
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 activates (e.g., clicks on) the "gobtn" element. The active duration will end 30 seconds after the parent time container begins.
<smil ...>
...
<par>
<audio src="music.au" begin="gobtn.activateEvent" repeatDur="indefinite"
end="30s" ... />
<img src="foo.jpg" dur="40s" ... />
</par>
...
</smil>
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.
<smil ...> ... <img src="image.jpg" end="activateEvent" /> ... </smil>
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 may 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.
<smil ...> ... <seq> <video dur="5s" repeatCount="3" end="activateEvent; next.activateEvent" .../> <video dur="5s" repeatCount="3" end="activateEvent; next.activateEvent" .../> <video dur="5s" repeatCount="3" end="activateEvent; next.activateEvent" .../> <video dur="5s" repeatCount="3" end="activateEvent; next.activateEvent" .../> <video dur="5s" repeatCount="3" end="activateEvent; next.activateEvent" .../> </seq> ... </smil>
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.
The min/max attributes provide the author with a way to control the lower and upper bound of the element active duration.
If there is any error in the argument value syntax for min, the attribute will be ignored (as though it were not specified).
The default value for min is "0". This does not constrain the active duration at all.
If there is any error in the argument value syntax for max, the attribute will be ignored (as though it were not specified).
The default value for max is "indefinite". This does not constrain the active duration at all.
If the "media" argument value is specified for either min or max on an element that does not define media
(e.g. on the SMIL 3.0 time container elements par, seq
and excl), the respective attribute
will be ignored (as though it were not specified). Contained media such as
the children of a par are not considered
media directly associated with the element.
If both min and max attributes are specified then the max value must be greater than or equal to the min value. If this requirement is not fulfilled then both attributes are ignored.
The rule to apply to compute the active duration of an element with min or max specified is the following: Each time the active duration of an element is computed (i.e. for each interval of the element if it begins more than once), this computation is made without taking into account the min and max attributes (by applying the algorithm described in Computing the active duration). The result of this step is checked against the min and max bounds. If the result is within the bounds, this first computed value is correct. Otherwise two situations may occur:
if the first computed duration is greater than the max value, the active duration of the element is defined to be equal to the max value (see the first example below).
if the first computed duration is less than the min value, the active duration of the element becomes equal to the min value and the behavior of the element is as follows :
if the repeating duration (or the simple duration if the element doesn't repeat) of the element is greater than min then the element is played normally for the (min constrained) active duration. (see the second and third examples below).
otherwise the element is played normally for its repeating duration (or simple duration if the element does not repeat) and then is frozen or not shown depending on the value of the fill attribute (see the fourth and fifth examples below).
This section is informative
The following examples illustrate some simple use cases for min and max attributes:
Example 1. In the following example, the video will only play for 10 seconds.
<smil ...> ... <par > <video xml:id="video_of_15s" max="10s".../> </par> ... </smil>
Example 2. In the following example, if an activate event happens before 10 seconds, this activation (e.g. click) does not interrupt the video immediately, but the video plays until 10 seconds and then stops. If a click event happens after 10 seconds, the video plays (repeating) until the click happens. Note, the endEvent is only raised if a click occurs after 10 seconds, not at the simple end of each repeat.
<smil ...> ... <par > <video xml:id="video_of_15s" repeatDur="indefinite" end="activateEvent" min="10s".../> </par> ... </smil>
Example 3. In the following example, if an activate event happens on element "foo" at 5 seconds, this event does not end the time container immediately, but rather at 12 seconds. The simple duration is defined to be "indefinite" (because an end attribute is specified with no dur attribute), and so the time container plays normally until it ends at 12 seconds.
<smil ...> ... <par end="foo.activateEvent" min="12s" > <video xml:id="video_of_15s" .../> <video xml:id="video_of_10s" .../> </par> ... </smil>
Example 4. In the following example, if a click event happens on the first video at 5 seconds, then the simple duration of the time container is computed as 5 seconds. Respecting the fill attribute in the time between the end of the simple duration and the end of the active duration, the two videos are frozen between 5 seconds and 12 seconds.
<smil ...> ... <par endsync="first" min="12s" fill="freeze" > <video xml:id="video_of_15s" end="activateEvent" ...> <video xml:id="video_of_10s" .../> </par> ... </smil>
Example 5. In the following example, the time container simple duration is
defined to be 5 seconds, and the min constraint defines the active duration
to be 12 seconds. Since the default value of fill in this case is "remove",
nothing is shown for the time container between 5 seconds and 12 seconds.
<par dur="5s" min="12s" > <video xml:id="video_of_15s" .../> <video xml:id="video_of_10s" .../> </par>
This section is informative
If an element is defined to begin before its parent (e.g. with a simple negative offset value), the min duration is measured from the calculated begin time not the observed begin (see example 1 below). This means that the min value may have no observed effect (as in example 2 below).
Example 1. In the following example, the image will be displayed from the beginning of the time container for 2 seconds.
<par> <img xml:id="img" begin="-5s" min="7s" dur="5s" .../> </par>
Example 2. In the following example, the image will not be displayed at all.
<par> <img xml:id="img" begin="-5s" min="4s" dur="2s" .../> </par>
See also the sections The min attribute and restart and Time container constraints on child durations.
The syntax specifications are defined using EBNF notation as defined in XML 1.1 [XML11]
In the syntax specifications that follow, allowed white space is indicated as "S", defined as follows (taken from the [XML11] definition for 'S'):
S ::= (#x20 | #x9 | #xD | #xA)+
A Begin-value-list is a semi-colon separated list of timing specifiers:
Begin-value-list ::= Begin-value (S? ";" S? Begin-value-list )? Begin-value ::= (Offset-value | Syncbase-value | Event-value | Repeat-value | Accesskey-value | Media-Marker-value | Wallclock-sync-value | "indefinite" )
An End-value-list is a semi-colon separated list of timing specifiers:
End-value-list ::= End-value (S? ";" S? End-value-list )? End-value ::= (Offset-value | Syncbase-value | Event-value | Repeat-value | Accesskey-value | Media-Marker-value | Wallclock-sync-value | "indefinite" )
Several of the timing specification values have a similar syntax. To
parse an individual item in a value-list, the following approach defines the
correct interpretation. In addition, Id-values and Event-symbols are XML NMTOKEN values and
as such are allowed to contain the full stop '.' and
hyphen-minus '-' characters. The reverse solidus character '\' must be used
to escape these characters within Id-values and Event-symbols, otherwise these characters
will be interpreted as the full stop separator and hyphen-minus sign,
respectively. Once these rules are interpreted, but before Id-values in
syncbase values, event values, or media-marker values are further handled,
all leading and embedded escape characters should be removed.
'+' or '-'), the value should be parsed as an
offset value..'
characters preceded by a reverse solidus '\' escape
character should not be treated as a separator, but as a normal token
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.This section is informative
This approach allows implementations to treat the
tokens wallclock and
indefinite as reserved element IDs, and begin, end and marker as reserved event names, while retaining an
escape mechanism so that elements and events with those names may be
referenced.
Clock values have the following syntax:
Clock-value ::= ( Full-clock-value | Partial-clock-value | Timecount-value ) Full-clock-value ::= Hours ":" Minutes ":" Seconds ("." Fraction)? Partial-clock-value ::= Minutes ":" Seconds ("." Fraction)? Timecount-value ::= 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).
This section is informative
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 millisecondsFractional values are just (base 10) floating point definitions of seconds. The number of digits allowed is unlimited (although actual precision may vary among implementations).
This section is informative
For example:
00.5s = 500 milliseconds 00:00.005 = 5 milliseconds
This section is informative
Offset values are used to specify when an element should begin or end relative to its syncbase.
An offset value has the following syntax:
Offset-value ::= ( S? ("+" | "-") S? )? ( Clock-value )
The implicit syncbase for an offset value is dependent upon the time container:
This section is informative
Deprecated.
SMIL-1-syncbase-value ::= SMIL-1-Id-value ( "(" ( "begin" | "end" | Clock-value) ")" )? SMIL-1-Id-value ::= "id(" Idref ")"
ID reference values are references to the value of an "id" attribute of another element in the document.
Id-value ::= Id-ref-value Id-ref-value ::= Idref | Escaped-Id-ref-value Idref ::= Name Escaped-Id-ref-value ::= Escape-Char? NameStartChar (Escape-Char? NameChar)* Escape-Char ::= "\"
Name, NameStartChar
and NameChar are defined in XML 1.1 [XML11].Idref is a legal XML identifier.If the element referenced by the Idref is ignored as described in the Content Control modules (e.g. if it specifies test attributes that evaluate false), the associated time value (i.e.. the syncbase value or the eventbase value that specifies the Id-value) will be considered invalid.
This section is informative
The semantics of ignored elements may change in a future version of SMIL. One possible semantic is that the associated sync arc arguments will not be invalid, but will instead always be "unresolved". When this behavior needs to be simulated in this version of SMIL Timing and Synchronization, an author may include the value "indefinite" in the list of values for the begin or end attribute.
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.
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"
The syncbase element is qualified with one of the following time symbols:
This section is informative
Examples
begin="x.end-5s" : Begin 5 seconds before "x"
ends
begin=" x.begin " : Begin when "x" begins
end="x.begin + 1min" : End 1 minute after "x" begins
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 may be observed. Refer to DOM-Level2-Events [DOM2Events] for details.
An event value has the following syntax:
Event-value ::= ( Eventbase-element "." )? Event-symbol ( S? ("+"|"-") S? Clock-value )? Eventbase-element ::= Id-value Event-symbol ::= Nmtoken
The symbol Nmtoken is defined in XML 1.1 [XML11].
The eventbase-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). A host language designer may override the definition of the default eventbase element. As an example of this, the SMIL 3.0 Animation modules describe Timing integration requirements for the animation elements (animate, animateMotion, etc.). These requirements specify that the default eventbase element is the target element of the animation. See the section Common Animation Integration Requirements.
The event value must specify an Event-symbol. This term is an XML NMTOKEN that specifies the name of the event that is raised on the Event-base element. The host language designer must specify which events may be specified.
If an integrating language specifies no supported events, the event-base time value is effectively unsupported for that language.
A host language may choose not to include support for offsets with event values. The language must specify if this support is omitted.
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 activateEvent or 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.
This section is informative
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 a "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:
<smil ...> ... <video xml:id="foo" repeatCount="10" end="endVideo.activateEvent" ... /> <img xml:id="endVideo" begin="foo.repeat(2)" .../> ... </smil>
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 ::= DIGIT+
If this qualified form is used, the eventbase value will only be resolved when a repeat is observed that has an Iteration value that matches the specified iteration.
This section is informative
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 key press, independent of focus issues. It is modeled on the HTML accesskey support. Unlike with HTML, user agents should not require that a modifier key (such as "ALT") be required to activate an access key.
An access key value has the following syntax:
Accesskey-value ::= "accesskey(" Char ")" ( S? ("+"|"-") S? Clock-value )?
The Char symbol is defined in XML 1.1 [XML11].
The time value is defined as the time that the access key character is input by the user.
This section is informative
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.
Media-Marker-value ::= Id-value ".marker(" S? Marker-name S? ")" Marker-name ::= (Char - ")")+
Char symbol is defined in XML 1.1 [XML11].Marker-name symbol is a string that must conform to the definition of
marker names for the media associated with the Id-value.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].
Wallclock-sync-value ::= "wallclock(" S? (DateTime | WallTime | Date) 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 )
This section is 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.
There are three ways of handling time zone offsets:
This section is informative
The presentation engine must be able to convert wallclock-values to a time within the document.
This section is 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.
This section is informative
The following examples all specify a begin at midnight on January 1st 2000, UTC:
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 )"
The endsync attribute controls the implicit 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.
This section is informative
The endsync attribute is particularly useful with children that have "unknown" duration, e.g. an MPEGmovie, that must be played through to determine the duration, or elements with event-based end timing.
Elements may have an unresolved or indefinite begin time when the parent begins. If an element's unresolved begin time becomes resolved (and definite) before the parent time container ends the simple duration, the element must be considered by the endsync="last" semantics.
This comment is informative.
This may chain, so that only one element is running at one point, but before it ends its active duration another interactive element is resolved. It may even yield "dead time" (where nothing is playing), if the resolved begin is after the other elements active end.
If the endsync semantics consider any child that has an unresolved active duration, then the implicit duration of the time container is also unresolved.
For the Id-value arg-value variant, the referenced child may have an unresolved begin time. If this causes the active end time to be unresolved as well, the implicit duration of the time container is also unresolved.
If the endsync semantics consider any child that has a (resolved) indefinite active duration, then the implicit duration of the time container is also indefinite.
Media element time containers define an intrinsic duration equal to the duration of the referenced media.
This comment is informative.
If the referenced media is not continuous, the duration is 0 (endsync="media" will not generally be useful on discrete media).
If the media argument value is used for an element that does not declare media, the attribute is ignored (as though endsync had not been specified).
If the Id-value arg-value variant is not an immediate child of the time container, it is as if endsync is not specified.
For the purpose of parsing the endsync argument value, first, last, all, and media are reserved words and must be escaped with a backslash in order to be used as Id-value's.
Semantics of endsync and dur and end:
Semantics of endsync and restart:
Semantics of endsync and paused elements:
Note that child elements of an excl that are currently paused (by the
excl semantics) have not ended
their active duration. Similarly, any element paused via the DOM
pause() method has not completed its active duration. Paused
elements (that have not already completed the active duration at least
once) must be considered in the evaluation of endsync.
This comment is informative.
For example, if a time container with endsync="last" has paused child elements, the simple
duration of the time container will not end until the paused children
resume or otherwise end.
This section is informative
Semantics of endsync and unresolved child times:
="first" means that the element must wait for any
child element to actually end its active duration. It does not matter
whether the first element to end was scheduled or interactive.="last" means that the element must wait for all
child elements that have a resolved begin, to end the respective active
durations. ="all" means that the element must wait for the end
of every child element's active duration. =[Id-value] means that the element must
wait for the referenced element to actually end its active duration.The following pseudo-code describes the endsync algorithm:
//
// boolean timeContainerHasEnded()
//
// method on time containers called to evaluate whether
// time container has ended, according to the rules of endsync.
// Note: Only supported on par and excl
//
// A variant on this could be called when a child end is updated to
// create a scheduled (predicted) end time for the container.
//
// Note that we never check the end time of children - it doesn't matter.
//
// Assumes:
// child list is stable during evaluation
// isActive state of children is up to date for current time.
// [In practice, this means that the children must all be
// pre-visited at the current time to see if they are done.
// If the time container is done, and repeats, the children
// may be resampled at the modified time.]
//
// Uses interfaces:
// on TimedNode:
// isActive() tests if node is currently active
// hasStarted() tests if node has (ever) begun
// begin and end begin and end TimeValues of node
//
// on TimeValue (a list of times for begin or end)
// is Resolved(t) true if there is a resolved time
// at or after time t
//
boolean timeContainerHasEnded()
{
TimeInstant now = getCurrentTime(); // normalized for time container
boolean assumedResult;
// For first or ID, we assume a false result unless we find a child that has ended
// For last and all, we assume a true result unless we find a disqualifying child
if( ( endsyncRule == first ) || ( endsyncRule == ID ) )
assumedResult = false;
else
assumedResult = true;
// Our interpretation of endsync == all:
// we're done when all children have begun, and none is active
//
// loop on each child in collection of timed children,
// and consider it in terms of the endsyncRule
foreach ( child c in timed-children-collection )
{
switch( endsyncRule ) {
case first:
// as soon as we find an ended child, return true.
if( c.hasStarted() & !c.isActive() )
return true;
// else, keep looking (assumedResult is false)
break;
case ID:
// if we find the matching child, just return result
if( endsyncID == c.ID )
return( c.hasStarted() & !c.isActive() );
// else, keep looking (we'll assume the ID is valid)
break;
case last:
// we just test for disqualifying children
// If the child is active, we're definitely not done.
// If the child has not yet begun but has a resolved begin,
// then we're not done.
if( c.isActive()
|| c.begin.isResolved(now) )
return false;
// else, keep checking (the assumed result is true)
break;
case all:
// we just test for disqualifying children
// all_means_last_done_after_all_begin
// If the child is active, we're definitely not done.
// If the child has not yet begun then we're not done.
// Note that if it has already begun,
// then we still have to wait for any more resolved begins
if( c.isActive() || !c.hasStarted()
|| c.begin.isResolved(now) )
return false;
// else, keep checking (the assumed result is true)
break;
} // close switch
} // close foreach loop
return assumedResult;
} // close timeContainerHasEnded()
This section is informative
SMIL 1.0 introduced the repeat attribute, which is used to repeat a media element or an entire time container. SMIL 2.0 introduces two new controls for repeat functionality that supersede the SMIL 1.0 repeat attribute. The new attributes, repeatCount and repeatDur, provide a semantic that more closely matches typical use-cases, and the new attributes provide more control over the duration of the repeating behavior.
Repeating an element causes the simple duration to be "played" several times in sequence. This will effectively copy or loop the contents of the element media (or an entire timeline in the case of a time container). The author may specify either how many times to repeat, using repeatCount, or how long to repeat, using repeatDur. Each repeat iteration is one instance of "playing" the simple duration.
This section is informative
This section is informative
In the following example, the implicit duration of the audio is constrained by repeatCount. Only the first half of the clip will play; the active duration will be 1.5 seconds.
<audio src="3second_sound.au" repeatCount="0.5" />
In this example, the 3 second (implicit) simple duration will be played three times through and then is constrained by the dur attribute on the parent par; the active duration will be 9 seconds.
<par dur="9s"> <audio src="3second_sound.au" repeatCount="100" /> </par>
In the following example, the 2.5 second simple duration will be repeated twice; the active duration will be 5 seconds.
<audio src="background.au" dur="2.5s" repeatCount="2" />
In the following example, the 3 second (implicit) simple duration will be repeated two full times and then the first half is repeated once more; the active duration will be 7.5 seconds.
<audio src="3second_sound.au" repeatCount="2.5" />
In the following example, the audio will repeat for a total of 7 seconds. It will play fully two times, followed by a fractional part of 2 seconds. This is equivalent to a repeatCount of 2.8.
<audio src="music.mp3" dur="2.5s" repeatDur="7s" />
Note that if the simple duration is indefinite, repeat behavior is not defined (but repeatDur still contributes to the active duration). In the following example the simple duration is 0 and indefinite respectively, and so the repeatCount is ignored. Nevertheless, this is not considered an error. The active duration is equal to the simple duration: for the first element, the active duration is 0, and for the second element, the active duration is indefinite.
<img src="foo.jpg" repeatCount="2" /> <img src="bar.png" dur="indefinite" repeatCount="2" />
In the following example, the simple duration is 0 for the image and indefinite for the text element, and so repeat behavior is not meaningful. The active duration is 0 for the first element, however for the second element, the active duration is determined by the repeatDur value, and so is 10 seconds. The effect is that the text is shown for 10 seconds.
<img src="foo.jpg" repeatDur="10s" /> <text src="intro.html" dur="indefinite" repeatDur="10s" />
In the following example, if the audio media is longer than the 5 second repeatDur, then the active duration will effectively cut short the simple duration.
<audio src="8second_sound.au" repeatDur="5s" />
The repeatCount and repeatDur attributes may also be used to repeat an entire timeline (i.e. a time container simple duration), as in the following example. The sequence has an implicit simple duration of 13 seconds. It will begin to play after 5 seconds, and then will repeat the sequence of three images 3 times. The active duration is thus 39 seconds long.
<seq begin="5s" repeatCount="3" > <img src="img1.jpg" dur="5s" /> <img src="img2.jpg" dur="4s" /> <img src="img3.jpg" dur="4s" /> </seq>
This section is informative
The min attribute does not prevent an element from restarting before the minimum active duration is reached. If in the following example, the "user.activateEvent" occurs once at 2 seconds, then again at 5 seconds, the "image" element will begin at 2 seconds, play for 3 seconds, and then be restarted at 5 seconds. The restarted interval (beginning at 5 seconds) will display the image until 12 seconds.
<smil ...>
...
<par>
<img xml:id="image" begin="user.activateEvent" min="7s" dur="5s"
restart="always" fill="freeze".../>
</par>
...
</smil>
This section is informative
The SMIL 1.0 repeat attribute behaves in a manner similar to repeatCount, but it defines the functionality in terms of a sequence that contains the specified number of copies of the element without the repeat attribute. This definition has caused some confusion among authors and implementers. See also the SMIL 1.0 specification [SMIL10].
In particular, there has been confusion concerning the behavior of the SMIL 1.0 end attribute when used in conjunction with the repeat attribute. SMIL 3.0 complies with the common practice of having the end attribute define the element's simple duration when the deprecated repeat attribute is used. Only SMIL document user agents must support this semantic for the end attribute. Only a single SMIL 1.0 "end" value (i.e. an Offset-value or a SMIL-1-syncbase-value, but none of the new SMIL 2.0 timing) is permitted when used with the deprecated repeat attribute. If repeat is used with repeatCount or repeatDur on an element, or if repeat is used with an illegal end value, the repeat value is ignored.
This section is informative
When an element's active duration ends, it may be frozen at the final state, or it may no longer be presented (i.e., its effect is removed from the presentation). Freezing an element extends it, using the final state defined in the last instance of the simple duration. This may be used to fill gaps in a presentation, or to extend an element as context in the presentation (e.g. with additive animation - see the SMIL 3.0 Animation chapter).
The fill attribute allows an author to specify that an element should be extended beyond the active duration by freezing the final state of the element. The fill attribute is also used to determine the behavior when the active duration is less than the duration specified in the min attribute. For this reason, rather than referring to the end of the active duration, this description refers to the "last instance of the simple duration".
The last instance of the simple duration is the last frame or value that was played during the last instance (see The instance times lists) of the simple duration of the element before it finished or was stopped because of an end attribute.
This section is informative
The syntax of the fill attribute is the same as in SMIL 1.0, with two extensions. In addition, the fill attribute may now be applied to any timed element, including time containers.
="hold") will refresh their display area
when a layer is added on top then later removed.This section is informative.
Note that given the default values for fill and fillDefault attributes, if the fill attribute is not specified for an element, and if the fillDefault attribute is not specified for any ascendant of the element, the behavior uses "auto" semantics.
An element with "freeze" behavior is extended according to the parent time container:
="freeze"
is equivalent to fill="hold".When applied to media, fill only has a presentation effect on visual media. Non-visual media (audio) will simply be silent (although they are still frozen from a timing perspective).
The effects of the fill attribute apply only to the timing semantics. If an element is still visible while frozen, it behaves normally with respect to other semantics such as user event processing. In particular, elements such as a and area are still sensitive to user activation (e.g. clicks) when frozen. See also the SMIL 1.0 specification [SMIL10].
This section is informative
The fill attribute may be used to maintain the value of a media element after the active duration of the element ends:
<par endsync="last"> <video src="intro.mpg" begin= "5s" dur="30s" fill="freeze" /> <audio src="intro.au" begin= "2s" dur="40s"/> </par>
The video element ends 35 seconds after the parent time container began, but the video frame at 30 seconds into the media remains displayed until the audio element ends. The attribute "freezes" the last value of the element for the remainder of the time container's simple duration.
This functionality is also useful to keep prior elements on the screen while the next item of a seq time container prepares to display as in this example:
<seq> <video xml:id="v1" fill="freeze" src.../> <video xml:id="v2" begin="2s" src.../> </seq>
The first video is displayed and then the last frame is frozen for 2 seconds, until the next element begins. Note that if it takes additional time to download or buffer video "v2" for playback, the first video "v1" will remain frozen until video "v2" actually begins.
This section is informative
Note that there are several ways that an element may be restarted. The behavior (i.e. to restart or not) in all cases is controlled by the restart attribute. The different restart cases are:
As with any begin time, if an element is scheduled to restart after the end of the parent time container simple duration, the element will not restart.
For the precise definition of when restart semantics apply, see the section Evaluation of begin and end time lists.
="never" will be reset, and the element may begin
again normally. See also Resetting element state.The restartDefault attribute may be used to control the default behavior of the restart attribute. This is described below in Controlling the default behavior of restart.
This section is informative.
For details on when and how the restart attribute is evaluated, see Evaluation of begin and end time lists.
This section is informative
A common use-case requires that the same UI event is used to begin an element and to end the active duration of the element. This is sometimes described as "toggle" activation, because the UI event toggles the element "on" and "off". The restart attribute can be used to author this, as follows:
<smil ...>
...
<img xml:id="foo" begin="bar.activateEvent" end="bar.activateEvent"
restart="whenNotActive" ... />
</smil>
If "foo" were defined with the default restart behavior "always", a second activateEvent on the "bar" element would simply restart the element. However, since the second activateEvent cannot restart the element when restart is set to "whenNotActive", the element ignores the "begin" specification of the activateEvent event. The element may then use the activateEvent event to end the active duration and stop the element.
Note that in SMIL Language documents, a SMIL element cannot be visible
before it begins so having a begin="activateEvent" means it won't ever begin. In languages
with timeAction support, this may not be the case. For example,
the following is reasonable:
<html xmlns:smil="http://www.w3.org/ns/SMIL" ...> ... <span smil:begin="click" smil:end="click" smil:timeAction="class:highlight" smil:restart="whenNotActive"> Click here to highlight. Click again to remove highlight. </span> ... </html>
This is based upon the event sensitivity semantics described in Event sensitivity and Unifying Scheduling and Interactive Timing.
The following attribute is provided to specify the default behavior for restart:
This section is informative.
Given the default values of this attribute
("inherit")
and of the restart attribute
("default"), a document that does not specify these attributes will have
restart="always" behavior for all timed elements.
When a time container repeats or restarts, all descendant children are "reset" with respect to certain state:
This section is informative
Thus, for example if an element specifies restart="never", the element may begin again after a reset. The
restart="never" setting is only defined for the extent of the
parent time container simple duration.
When an element restarts, rules 1 and 2 are also applied to the element itself, although rule 4 (controlling restart behavior) is not applied.
Note that when any time container ends its simple duration (including when it repeats), all timed children that are still active are ended. See also Time container constraints on child durations.
When an excl time container restarts or repeats, in addition to ending any active children, the pause queue for the excl is cleared.
This section is informative
New support in SMIL 2.0 introduces finer grained control over the runtime synchronization behavior of a document. The syncBehavior attribute allows an author to describe for each element whether it must remain in a hard sync relationship to the parent time container, or whether it may be allowed slip with respect to the time container. Thus, if network congestion delays or interrupts the delivery of media for an element, the syncBehavior attribute controls whether the media element may slip while the rest of the document continues to play, or whether the time container must also wait until the media delivery catches up.
The syncBehavior attribute may also be applied to time containers. This controls the sync relationship of the entire timeline defined by the time container. In this example, the audio and video elements are defined with hard or "locked" sync to maintain lip sync, but the "speech" par time container is allowed to slip:
<par>
<animation src="..." />
...
<par xml:id="speech" syncBehavior="canSlip" >
<video src="speech.mpg" syncBehavior="locked" />
<audio src="speech.au" syncBehavior="locked" />
</par>
...
</par>
If either the video or audio must pause due to delivery problems, the entire "speech" par will pause, to keep the entire timeline in sync. However, the rest of the document, including the animation element will continue to play normally. Using the syncBehavior attribute on elements and time containers, the author can effectively describe the "scope" of runtime sync behavior, defining some portions of the document to play in hard sync without requiring that the entire document use hard synchronization.
This functionality also applies when an element first begins, and the media must begin to play. If the media is not yet ready (e.g. if an image file has not yet downloaded), the syncBehavior attribute controls whether the time container must wait until the element media is ready, or whether the element begin may slip until the media is downloaded.
An additional extension allows the author to specify that a particular element should define or control the synchronization for a time container. This is similar to the default behavior of many user agents that "slave" video and other elements to audio, to accommodate the audio hardware inaccuracies and the sensitivity of listeners to interruptions in the audio playback. The syncMaster attribute allows an author to explicitly define that an element defines the playback "clock" for the time container, and all other elements should be held in sync relative to the syncMaster element.
In practice, linear media often need to be the syncMaster, where non-linear media can more easily be adjusted to maintain hard sync. However, a user agent cannot always determine which media behaves in a linear fashion and which media behaves in a non-linear fashion. In addition, when there are multiple linear elements active at a given point in time, the user agent cannot always make the "right" decision to resolve sync conflicts. The syncMaster attribute allows the author to specify the element that has linear media, or that is "most important" and should not be compromised by the syncBehavior of other elements.
The argument value independent is
equivalent to setting syncBehavior="canSlip" and syncMaster="true" so that the element is scheduled within
the timegraph, but is unaffected by any other runtime synchronization
issues. Setting syncBehavior="canSlip" and syncMaster="true" declares the element as being the
synchronization master clock and that the element may slip against its
parent time line
="locked", the syncMaster will also define sync
for the ancestor timeContainer. The syncMaster will define sync for
everything within the closest ancestor time container that is defined
with syncBehavior="canSlip".