Re: [web-animations] Fixing start time and pausing

On 2014/10/22 1:30, Tab Atkins Jr. wrote:
> On Mon, Oct 20, 2014 at 11:50 PM, Brian Birtles <bbirtles@mozilla.com> wrote:
>> The key point is 2. I think we can actually represent pausing by an
>> unresolved start time. This simplifies the model and helps answer some of
>> the tricky questions that arise about start times. In particular I think it
>> would look something like this:
>
> Does this mean that you can't unpause unless you stashed the old
> start-time away before setting it to unresolved?

No, if you want to resume from your current pause time, you just need to 
calculate the start time from the current time.

For example,

   player.startTime = document.timeline.currentTime
                      - player.currentTime / player.playbackRate;

That's what player.play() does internally.

(Which, by the way, I'm not suggesting we drop. Just that if you *were* 
to set startTime while paused it should probably unpause.)

Best regards,

Brian

Received on Tuesday, 21 October 2014 23:46:46 UTC