Re: [csswg-drafts] [web-animations-2] Add `Animation.started` and `Animation.playing` promises (#5871)

Thank you for taking the time to explain this use case. I really appreciate it. I've read it through and I think I understand the scenario.

Firstly, I think you'd want to define that such a promise is replaced when `cancel()` is called. That method causes the `currentTime` to become `null` so I think that matches the usage you outlined.

That said, I'm still not sure that this pattern is common enough to warrant adding to the platform. Like you said, you could accomplish your particular case by wrapping the `play()` / `pause()` / ` animate()` methods to add the desired behavior.

For the timeline UI case, I think it might be better to pursue a more generic animation mutation observer API. That's what Firefox uses internally for its animation DevTools and I'm told Chrome has something similar so if we could standardize the behavior of this interface we could potentially expose it to Web content. It's more work to specify, but likely to be useful to more applications.

Of course, if you can convince other parties that the `played` Promise is generally useful, I'm happy to see it added.

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5871#issuecomment-761922290 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 18 January 2021 01:21:45 UTC