W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2012

Re: [web-anim] automatically discarding animations

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Mon, 6 Aug 2012 10:15:56 +0200
Message-ID: <DC61D8EDFF0C45A8A88B02EB04BE82CA@FREMYD2>
To: "Brian Birtles" <birtles@gmail.com>, <public-fx@w3.org>
> > As far as I can envision, I can see up to four different time sources
> > being supported :
> >
> >     - RigidTimeSource implements TimeSource
> >     - FluidTimeSouce implements TimeSource
> >     - TimedItem implements TimeSource
> >     - HTMLMediaElement (implements TimeSource)
> I think HTMLMediaElement and TimedItem should share the same behavior with 
> regards to inheriting time (since you want to be able to put a <video> in 
> a <par> or <seq>). In fact, I think all time sources should inherit time 
> from their parent. Root level time sources (the effects and content 
> timelines) get their time from the OS.

Okay so, you mean that if I want a custom time source I should just create 
an animation group and use its built-in time source (which inherits time 
from the root time source) and seek/timeDrift/playbackRate-related methods 
and properties to have it work as if I had a custom timeline, right? This is 
an interesting, unified approach.

This would lead us into a model where :

- The default TimeSource (RootAnimationGroup) inherits time from the OS 
time, is not seekable.

- Every other timesource inherits time from its parent by default 
currentTime=min(currentTime, animationDuration); iterationTime=(currentTime 
mod iterationDuration);).

- Animations groups can either have "isSeekable" set to true or false (set 
on creation only, readonly after). If "isSeekable" is true, we can rewind 
the animation group (timeDrift and playbackRate are read-write). If it's set 
to false, an attempt to modify timeDrift/playbackRate/other throws an 
exception. By default, timeDrift is equal to the time the parent time source 
had when the animation started.

- Animations groups have both "hasSeekableItems" and "hasSeekableParent" 
properties which is true if any element of the group is seekable or if any 
parent timesource is seekable. When an animation becomes inactive in a 
"isSeekable=false,hasSeekableParent=false" animation group, it's 
automatically removed from the group. If a 
"isSeekable=false,hasSeekableItems=false,hasSeekableParent=false" animation 
group becomes inactive (no animation or animation group inside it can be 
active anymore), it's also removed automatically from its parent group.

- An HTMLMediaElement is a time source; by default (if not specified in the 
markup) the media elements inherits their time from the document, but have 
isSeekable set to true; this is why we can pause them. If child animations 
are added to an HTMLMediaElement, its seekable timesource becomes the root 
time for those animations; any rewind in the video timeline affects its 
child animations.

Am I correct? 
Received on Monday, 6 August 2012 08:16:26 UTC

This archive was generated by hypermail 2.3.1 : Monday, 22 June 2015 03:33:48 UTC