Archived Article
developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  

Developer Jobs

Be a Commerce Partner
Business Search
Payment Solutions
Best Deals on PDAs!
Earn Your IT Degree
Reference Library
Submit Your Site
Tech Magazines - FREE
Business Search
Web Based Software
Remote PC Access

 

 

Developer News -
Open-Source Portlet Site Opens For Business    November 10, 2003
Microsoft Goes Back to School for Visual Studio    November 7, 2003
Intel Purchases Bluetooth, Wi-Fi Developer    November 7, 2003
The Push For Aspect-Oriented Programming    November 7, 2003
Free Tech Newsletter -

Customizing Multimedia with a SMIL
By John Maxwell Hobbs

While many people are familiar with XML as a means of abstracting data from its HTML presentation, few seem aware of such capabilities in the realm of multimedia. If you find yourself tailoring presentations to different display or throughput considerations, or you're creating multiple language versions of presentations, you'll want to explore the Synchronized Multimedia Integration Language (SMIL). In particular, SMIL's <switch> tag can simplify your life and make customizing presentations easier.

 

SMIL is a recommendation from the World Wide Web Consortium (W3C) for the easy implementation of sophisticated time-based multimedia content on the Web. SMIL is an XML extension and currently in version 1.0. While is still relatively young, it has SMIL is currently supported for Windows, Unix and Macintosh by Oratex and for Windows and Macintosh by Real Networks.


For customizing media delivery to smart phones and communicators, SMIL really shines when compared to other systems.

The basics of SMIL creation have been covered in an earlier article: The Synchronized Multimedia Interface Language. Unlike monolithic multimedia presentation formats like Shockwave, SMIL is a distributed format, like HTML. A .smil file is a text file in a declarative format that instructs the SMIL browser to fetch source multimedia files from various locations and render them at the specified times for the specified durations. This allows the presentation to be easily modified after creation, simply by replacing a source file, rather than having to re-author the entire presentation.

 

Switching your presentations

 

The <switch> element in SMIL takes advantage of this to allow customized presentations to be created based on bandwidth availability, hardware constraints, and user preferences.

 

The <switch> element has three criteria:

 

  1. A valid SMIL element
  2. A valid media type
  3. A valid test attribute

 

and takes the following form:

 

<switch>
     <option1 test-attribute="media1">
     <option2 test-attribute="media2">
</option2>
</option1>
</switch>

Valid test attributes are:

system-bitrate
the bandwidth available to the system, determined either through bandwidth detection, or by user preference settings

system-captions
a "closed-captioning" option determined by user preference settings

system-language
a language selection option determined by user preference settings and selected from comma-separated list of language names as defined in [RFC1766]

system-overdub-or-caption
a user selected option that determines a preference for language translation via subtitles or overdubs when a translation option is available

system-required
this is in place for future extensions to SMIL

system-screen-size
allows the browser to determine if the device is able to display a presentation of a specific size. The test attribute is stated as "screen-size-val ::= screen-height"X"screen-width" with the size being specified in pixels

system-screen-depth
allows the presentation to specific the bit depth of the screen color palette required to display specific media.


Customizing a Presentation for Bandwidth

 

One of the biggest headaches facing multimedia content developers is the need for multiple presentations to deal with a wide variety of connection speeds. This headache is doubled when creating content that is updated often, as with newscasts. The system-bitrate test attribute makes it easy to deal with this. The following code fragment demonstrates how to easily deliver audio to a variety of bandwidths:

 

<switch>
     <audio src="lan-audio.au" system-bitrate="75000">
     <audio src="56k-audio.au" system-bitrate="47000"> 
     <audio src="/28k-audio.au" system-bitrate="20000">
</audio>
</audio>
</audio>
</switch>

 

The same audio material has been encoded at three target bitrates - one for LAN users, one for 56k modem users, and the third for 28k modem users. When creating the presentation, the choices should be ordered from the most desirable to the least desirable, with the last item being a fail-safe choice whenever possible. In certain situations, such as with video, when the bandwidth is very low the last option may need to be an alternative media type as in the example below:

<switch> 
     <video src="lan-video.rm" system-bitrate="75000">
     <video src="56k-video.rm" system-bitrate="47000"> 
     <video src="28k-video.rm" system-bitrate="20000">
     <img src="617511_files/slide.html">
</video>
</video>
</video>
</switch>

 

Since the .jpg file in the example above is the fallback choice, a test attribute is not necessary. If a choice within a <switch> tag does not have a test attribute specified, it will always function as the default choice if all of the other test attributes return a value of "FALSE."

 

The system-bitrate test attribute can also be used in a more sophisticated fashion to select between complete presentations optimized for specific bandwidths, as in this example .

Customizing for Devices

 

As non-PC based access to the Internet spreads through the use of smart phones and communicators, it will become necessary to customize media delivery for their varied capabilities. This is where SMIL shines compared to other systems. Take a look at this example .

 

The SMIL browser determines the display capabilities of the receiving device, and sends the appropriate version of the source file. If none of the test attributes are met, it defaults to an audio description of the video file. This option is particularly useful for someone accessing the content through a telephone-to-web gateway.

 

Adjusting for User Preferences

 

The Internet is an international communications network, and your users will likely speak a variety of languages. SMIL allows this issue to be addressed in a variety of ways. Perhaps the simplest is to provide audio tracks in a variety of languages.

It is possible to list multiple languages in a test attribute.  

Although this is perhaps the easiest way to address the language issue, it may not be the most aesthetically pleasing to all viewers. In the case of entertainment or artistic presentations, many users prefer to read subtitles while listening to the original audio track.

 

It is also possible to accommodates hearing-impaired viewers who want the presentation to be close-captioned in the original language.

 

As you can see from the above examples, the very simple parameters of the <switch> element can be combined to create very complex behaviors, ranging from approaches taken out of expediency, to those of presentations that allow for user customization. Through the use of these techniques, highly interactive presentations, similar to those becoming available on DVD systems, can be created. Through the use of the system-caption-or-overdub attribute, director's comments can be added to the presentation of a film. The system-captions attribute can be used not just to provide close-captioning for the hearing impaired, but used in a different fashion can provide audio description for the visually impaired as well. With the ability to provide alternative media types based on bandwidth and hardware constraints, aesthetically pleasing content can be delivered to a wider spectrum of users than was previously possible.

 

 

About the author:

John Maxwell Hobbs is a musician and has been working with computer multimedia for over fifteen years. He is currently Head of Creative Development at Ericsson CyberLab New York. His interactive composition Web Phases was one of the winners of ASCI's Digital '98 competition. He recently completed a Java-based interactive musical instrument in collaboration with artist/programmer Mark Napier called Ripple. He is also on the board of directors of Vanguard Visions, an organization dedicated to fostering the work of artists experimenting with technology and serves on the Digital Arts sub-committee of the Mayor's Council on New Media in New York City. He is the former Producing Director for The Kitchen.

 



XML Archives

Jupitermedia is publisher of the internet.com and EarthWeb.com networks.
Copyright 2003 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.
Advertise on EarthWeb
http://www.earthweb.com/
http://www.internet.com/