SMIL

From SpinetiX Support Wiki

Jump to: navigation, search

Introduction

Synchronized Multimedia Integration Language (SMIL) is a World Wide Web Consortium recommended XML markup language to describe multimedia presentations. It defines markup for timing, layout, animations, visual transitions, and media embedding, among other things. SMIL allows presenting media items such as text, images, video, audio, links to other SMIL presentations, and files from multiple web servers.

The HMP conforms to the following SMIL 3.0 modules:

How to include a SMIL playlist in a document

  • A SMIL playlist can be used within a parent SVG document, inside a parent SMIL playlist or to define a root playlist as index.smil.
  • Within an enclosing SVG document, it must be referred to by the <animation> element
  • Inside an enclosing SMIL playlist, it may be referred to by the <ref> element or its synonym the <animation> element.
  • The MIME type for SMIL documents is application/smil+xml. The filename extension .smil is mapped to application/smil+xml.
    • The deprecated application/smil MIME type is also recognized

Example:

<animation xlink:href='playlist.smil' width='1280' height='720' begin='0' dur='media' repeatDur='indefinite' />

Required structure for the SMIL playlist XML document

  • The SMIL playlist is an XML document with a <smil> document element.
  • The <smil> element must be either in no namespace or in the http://www.w3.org/ns/SMIL namespace.
  • If a <layout> elment is present in the <head> section, it must be of type text/smil-basic-layout (the lacuna value).
  • <region> elements under the <layout> will only be recognized if a <root-layout> element is present.
  • As an alternative syntax to <root-layout>, <topLayout> is supported. There must be at most one <topLayout>.
  • Remember that the <body> element as <seq> semantics whereas <svg> has <par> semantics !

Examples

Full screen playlist of images

<smil>
  <body>
    <seq repeatCount="indefinite">
      <img xml:id="frown" src="frown.jpg" dur="2s"/>
      <img xml:id="smile" src="smile.jpg" dur="2s"/>
    </seq>
  </body>
</smil>

Basic multizone layout

<smil>
  <head>
    <layout type="text/smil-basic-layout">
      <root-layout width="640" height="240"/>
      <region id="left" top="0%" left="0%" height="100%" width="50%"/>
      <region id="right" top="0%" left="50%" height="100%" width="50%"/>
    </layout>
  </head>
  <body>
    <par dur="5s">
      <img region="left" src="frown.jpg"/>
      <img region="right" src="smile.jpg"/>
    </par>
  </body>
</smil>

Subregions withs layout

<smil>
  <head>
    <layout>
      <topLayout width="640" height="480">
        <region id="whole" top="0" left="0" width="640" height="480" />
      </topLayout>
    </layout>
  </head>
  <body>
    <par>
      <img id="topLeft" region="whole" src="smile.jpg" top="0%" left="0%" dur="indefinite"/>
      <img id="topRight" region="whole" src="smile.jpg" top="0%" left="50%" dur="indefinite"/>
      <img id="bottomLeft" region="whole" src="smile.jpg" top="50%" left="0%" dur="indefinite"/>
      <img id="bottomRight" region="whole" src="smile.jpg" top="50%" left="50%" dur="indefinite"/>
    </par>
  </body>
</smil>

Supported SMIL Modules, exceptions and extensions

  • Structure Module (<smil>, <head>, <body>)
    • <body> is required. A SMIL document with no <body> is reported as a parse error.
    • The following attributes are added to the <smil> element. They have the same effect as on <svg> and are effective only if the SMIL playlist is the root document.
      • preserveAspectRatio to control the scaling of the SMIL presentation viewport inside a parent media element viewport.
      • playbackOrder to allow seeking backward into a scripted document without reloading the entire document (if set to 'all').
      • snapshotTime to specify the document time to be used when make a snapshot of the presentation.
      • The <script> element is added under the <head> element. It specifies a script to be executed before the presentation starts. It has the same semantics as inside SVG documents. The script is executed when the script element is added to the rendering tree, so elements below and after it in the XML structure are not present at this time. Install a handler on the load event to execute a script before the presentation starts but after all the XML document has been loaded.
  • Identity
  • BasicMedia
    • The following attributes are added to the <ref> element and its synonyms <animation>, <audio>, <img>, <text>, <textstream> and <video>.
    • The following media objects are added. Both have an implicit duration of zero.
      • <auxCmd> to send RS232 commands (same syntax as inside SVG documents).
      • <script> to execute a script in the time sequence. The script is executed once each times the object begins (but not when it repeats).
  • MediaRenderAttributes
    • erase is always set to whenDone.
    • mediaRepeat is always set to strip.
    • sensitivity supports only the values opaque and transparent.
  • MediaOpacity
    • mediaOpacity and mediaBackgroundOpacity are supported.
    • chromaKey, chromaKeyOpacity and chromaKeyTolerance are not supported.
  • BrushMedia (<brush>)
  • AccessKeyTiming
  • BasicInlineTiming
  • BasicTimeContainers
  • EventTiming
  • BasicExclTimeContainers (<excl>)
  • BasicPriorityClassContainers
  • FillDefault
  • MinMaxTiming
  • MultiArcTiming
  • RepeatTiming
  • RepeatValueTiming
  • RestartDefault
  • RestartTiming
  • SyncbaseTiming
  • WallclockTiming
  • DOMTimingMethods
  • StructureLayout (<layout>)
  • BasicLayout (<region>, <root-layout>)
  • AudioLayout
  • MultiWindowLayout
  • AlignmentLayout
  • OverrideLayout (except for z-index)
  • StateTest (must use Ecmascript, XPath is not supported)
  • Metainformation
  • BasicAnimation (Animation applies only to SVG documents)
  • SplineAnimation
This page was last modified on 6 July 2020, at 13:39.