W3C home > Mailing lists > Public > www-smil@w3.org > July to September 2006

[SMIL21 REC] 10.4.1: Wrong example for end and begin with user interactivity?

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Sun, 6 Aug 2006 12:57:15 +0200
To: www-smil@w3.org
Message-Id: <200608061257.15335.Dr.O.Hoffmann@gmx.de>


section 10.4.1 'The end attribute: controlling active duration'
contains the following example:

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 ...>
<audio src="music.au" begin="gobtn.activateEvent" repeatDur="indefinite"
          end="30s" ... />
     <img src="foo.jpg" dur="40s" ... />

Note that if the user has not clicked on the target element before 30 seconds 
the element will never begin. In this case, the element has no active duration 
and no 
active end.

Or something similar in the 'SMIL Animation W3C Recommendation
04-September-2001' version, related to SVG1.0 or SVG1.1:
In the following example, the animation begins when the user clicks on the
target element. The active duration will end 30 seconds after the document
begins. Note that if the user has not clicked on the target element before 30
seconds elapse, the animation will never begin.

<animate begin="click" dur="2s" repeatDur="indefinite" end="30s" ... />

Using end with an event value enables authors to end an animation based on
either an interactive event or a maximum active duration. This is sometimes
known as lazy interaction.

Lets have a try with a similar SVG example like this:

<circle id="gobtn0" cx="300" cy="300" r="250" fill="#ccf" 
   stroke-width="10" stroke="#00f">
<animateColor attributeName="fill" values="#ccf;#060;#ccf" dur="3s" 
   begin="gobtn0.click" repeatDur="indefinite" end="30s" fill="freeze" />

If we display it with a viewer like the adobe plugin or opera, we find a
different behaviour as described and I think the behaviour of these viewers 
is correct.
As far as I understand the section 10.4.3 'Evaluation of begin and end time 
(or 3.6.8 in the SMIL Animation W3C Recommendation 04-September-2001)
the descriptions seems to be wrong.

If we assume, that the user activates the "gobtn" element at 35s, the playing
of the music or the animation should start anyway, because the player/viewer
has to look in the end event list for a fitting 'end' later as 'begin' and not
before 'begin'.
To get the described behaviour, one can for example use a second animation for
the "gobtn" element. In SVG it is possible to set the property
'pointer-events' to 'none' after 30s for the "gobtn" element to get an effect
similar to the description, if a pointig device is used for interactivity:

<circle id="gobtn" cx="500" cy="500" r="400" fill="#ccf" 
   stroke-width="10" stroke="#00f" pointer-events="all">
  <animateColor attributeName="fill"  values="#ccf;#060;#ccf" 
     dur="5s" begin="gobtn.click" repeatDur="indefinite" end="30s"
     fill="freeze" />
  <set attributeName="pointer-events" to="none" begin="30s" />
  <set attributeName="stroke" to="#ccc" begin="30s" />

(The blue stroke indicates, that interactivity is possible, it turns to gray
to indicate that pointer-events is set to none.)

Would be nice to get a comment if my interpretation (which seems to be 
the same as from Adobe and Opera) is correct or not - and if it is correct to
get the error fixed soon.

Best wishes
Received on Sunday, 6 August 2006 10:54:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:25 UTC