Home arrow Multimedia arrow Page 5 - Learning To SMILe

Spending Time - Multimedia

Take a tour of SMIL, the Synchronized Multimedia Integration Language, and find out how you can use it to quickly and rapidly build Web-based multimedia offerings incorporating multiple media types.

  1. Learning To SMILe
  2. Getting The Tools
  3. Anatomy 101
  4. Laying It Out
  5. Spending Time
  6. Playing In Sync
  7. A Click In Time...
  8. Bedtime Reading
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 8
November 21, 2002

print this article


SMIL also includes a fairly sophisticated timing model which allows you to control the timing and synchronization of media objects within the lifetime of the SMIL presentation. Basic timing support is made available via the "begin" and "dur" attributes, which allow you to specify a start time and duration respectively for the media. Values for these attributes may be specified in terms of time values or event notifications. Here's an example:

... <img src="logo.jpg" alt="Image" region="alpha" begin="5s" /> ...
In this case, the media will begin playing (in other words, the image will be displayed) 5 seconds after the SMIL document has been loaded.

You can also specify a duration for the media:

... <img src="logo.jpg" alt="Image" region="alpha" begin="5s" dur="10s" /> ...
This sets up a clip of total duration 15 seconds, with the image appearing 5 seconds into playback.

You can repeat an element via the "repeatCount" attribute, as follows:

... <img src="logo.jpg" alt="Image" region="alpha" begin="5s" dur="10s" repeatCount="2" /> ...
This would set up a clip of total duration 25 seconds, with the image appearing 5 seconds into the clip.

It's also possible to explicitly terminate playback of a media clip before it gets to the end of its normal lifetime with SMIL's "end" attribute. Consider the following example, which demonstrates by ending a 10-second audio clip after 6 seconds.

... <audio src="bg.wav" region="alpha" end="6s"/> ...
It's also possible to begin or end clips on specific events, such as a mouse click or the start of any other media clip within the document. Consider the following example, which plays a video clip; the clip ends when the user clicks the mouse on it.

... <video src="video.rm" region="alpha" end="click" /> ...
A number of other options are available for event-based timing in SMIL take a look at the specification for a complete list, together with usage examples.

>>> More Multimedia Articles          >>> More By icarus, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Basic Lighting in OpenGL and SDL Game Progra...
- Working with Colors in OpenGL for Game Progr...
- Animation in OpenGL for Game Programming usi...
- Game Programming with SDL: Getting Started w...
- Using OpenGL with SDL for Game Programming
- Learning Sound for Game Programming using SDL
- Game Programming using SDL: Raw Graphics and...
- Game Programming using SDL: Getting Started
- Network Radio With Icecast
- Learning To SMILe

Developer Shed Affiliates


Dev Shed Tutorial Topics: