8000 [web-animations-2] [css-animations-2] Allow animations to be synchronized to the playback of audio or video elements · Issue #9110 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[web-animations-2] [css-animations-2] Allow animations to be synchronized to the playback of audio or video elements #9110

@bramus

Description

@bramus

(This was originally presented during the lightning round at the 2023 F2F in Cupertino)

With Scroll-Driven Animations we have defined some new types of timelines which authors can use to run an animation on. Besides the existing DocumentTimeline, authors can now use 72E9 a ScrollTimeline to animate based on a scroller’s scroll offset or ViewTimeline to animate as an element crosses its scrollport.

One thing that authors also want to do is synchronise their animations to the playback of an <audio> or <video> element; see list of links enclosed below

List of links

The proposal is to add a MediaPlaybackTimeline type of timeline which would allow that. Authors can use it tosync up animations to a media element – <audio> or <video> – play position.

Reusing the existing animation-timeline and animation-range syntax, the CSS code for it would look like this. A new media-playback-timeline to create a MediaPlaybackTimeline would also be introduced.

#video {
  media-playback-timeline: --video;
}

.animated {
  animation: slide linear forwards;
  animation-timeline: --video;
  animation-range: 1s 5s;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0