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

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

From: Sjoerd Mullender <sjoerd@acm.org>
Date: Mon, 07 Aug 2006 10:19:47 +0200
Message-ID: <44D6F7A3.3020907@acm.org>
To: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>
CC: www-smil@w3.org
On 2006-08-06 12:57, Dr. Olaf Hoffmann wrote:
> Hello,  
> 
> section 10.4.1 'The end attribute: controlling active duration'
> http://www.w3.org/TR/2005/REC-SMIL2-20051213/smil-timing.html#Timing-EndAttribute
> 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 ...>
> ....
> <par>
> <audio src="music.au" begin="gobtn.activateEvent" repeatDur="indefinite"
>           end="30s" ... />
>      <img src="foo.jpg" dur="40s" ... />
> </par>
> ....
> </smil>
> 
> Note that if the user has not clicked on the target element before 30 seconds 
> elapse, 
> 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" />
> </circle> 
> 
> 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 
> lists'
> http://www.w3.org/TR/2005/REC-SMIL2-20051213/smil-timing.html#Timing-EvaluationOfBeginEndTimeLists
> (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" />
> </circle> 
> 
> (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
> 
> 

Your interpretation and that of Opera and Adobe is *incorrect*.  After
t=30s the element cannot start again.  Study the pseudo code in
<http://www.w3.org/TR/SMIL2/smil-timing.html#Timing-BeginEnd-LC-Start>,
and especially the bit where it says: "if all ends are before the begin,
bad interval".  This shows that if there is an end attribute, and all
values in the end attribute are before the current time, there is no
interval, and thus the element will not play.

I hope this helps.

-- 
Sjoerd Mullender


Received on Monday, 7 August 2006 08:19:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:53:29 GMT