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  


Compare products, prices, and stores at Hardware Central!

Computers
Desktops, Mac & PC Notebooks, Monitors, Scanners, Webcams, PDA's, more...

Software
Creativity Applications, Programming Tools, Internet & Communication Applications, more...

Electronics
Digital Cameras & Accessories, GPS devices & Accessories, Camcorders, MP3 Players & Accessories, more...
Get the best price on Microsoft Visual Studio .NET Professional Edition or search for other development tools





Developer Jobs

Be a Commerce Partner
Business Search
Audio Conferencing
Shop Digital Cameras
Digital Camera Deals
Free Business Cards
Send a Press Release
Earn Your IT Degree
Stop Internet Viruses
Web Based Software
Shopping Cart

 


Compare products, prices, and stores at Hardware Central!

Computers
Desktops,
Mac & PC Notebooks,
Monitors, Scanners,
Webcams, PDA's,
more...

Software
Creativity Applications,
Programming Tools,
Internet
& Communication Applications,
more...

Electronics
Digital Cameras
& Accessories,
GPS devices
& Accessories,
Camcorders,
MP3 Players & Accessories,
more...

Get the best price on Microsoft Visual Studio .NET Professional Edition or search for other development tools





Get info on unique revenue share & strategic alliances
Developer News -
Linux Heavyweights Turn a Corner    November 6, 2003
China's Linux Plans Taking Shape    November 6, 2003
BEA Releases Finalized StAX    November 5, 2003
'Critical' Office 2003 Patch Released    November 5, 2003
Free Tech Newsletter -

Working with SMIL
By John Maxwell Hobbs

Go to page: 1  2  Next  

The Synchronized Multimedia Integration Language (SMIL) is a recommendation from the World Wide Web Consortium (W3C) intended to allow the easy implementation of sophisticated time-based multimedia content on the Web. SMIL is an XML extension and currently in version 1.0.

SMIL is currently supported for Windows, Unix and Macintosh in GRiNS from the Centrum voor Wiskunde en Informatica (CWI) and for Unix and Java in HPAS via the W3C. SMIL is also partially supported for Windows in the G2 Player beta at Real Networks, with the promise of full implementation in the final release. For this tutorial, I recommend using the GRiNS player.

Because of the nature of multimedia, you will need a high-speed connection to play the demos over the network, otherwise download the example files and media and run them locally.

Five easy pieces

Just how easy is easy? We'll begin with a simple slide show of my trip to the Great Wall of China. This was done in just 16 lines:



<smil>



<seq id="presentation">
<font face="Verdana, Arial, Helvetica" size="-1"><img id="fortress" region="image1" src="604851_files/fortress.jpg" dur="5s">
<img id="firstview" region="image1" src="604851_files/firstview.html" dur="5s">
<img id="tower" region="image1" src="604851_files/tower.html" dur="5s">
<img id="oldwall" region="image1" src="604851_files/oldwall.html" dur="5s">
<img id="longshot" region="image1" src="604851_files/longshot.html" dur="5s">
</font></seq>

</smil>

 

The first three lines inform the application that this document is an extension to XML 1.0 and gives a URI at the W3C's server where the application can find the Document Type Definition (DTD), if necessary. Following that, the remainder of the document looks quite similar to HTML.

This slide show is fairly boring, so let's add some visual interest and a bit of layout.

This .smil document is not much larger than the first, but it contains almost all the elements you will ever need to use.

The <head> of a .smil document contains the non-time-based information about the document: the title, meta information for search engines, and all the layout parameters for the presentation. SMIL allows you to set the overall size of the display area, regions based on position related to left and top edges, size of the regions, and layers specified by the z-index. In the example above, the "background" region is given an explicit z-index value of 0 -- when an image is placed in the "image 1" region, which has a z-index value of 1, it will appear on top of the background image.

The <body> of the document contains the instructions for the time-based elements and linking behavior of the document. This is where the two key elements of a SMIL document, the <seq> and <par> tags, are found. Media enclosed in a <seq> tag are presented in sequence. Media enclosed in a tag are played simultaneously, or in parallel. It's as easy as that. <seq> and <par> nodes can be nested to allow for complex, interrelated behavior.

Media types and their temporal behavior are described within the nodes. For example,

<tt> <img id="fortress" region="image1" src="604851_files/fortress.jpg" begin="5s" dur="5s"> </tt>

means that the image contained in the file "fortress.jpg" will be displayed in the "image 1" region five seconds after that sequence begins and will disappear after five seconds.

Go to page: 1  2  Next  



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/