-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control and coordinate video playback state with css #11587
Comments
Huge +1! This should also allow playing on |
Great use case! I added a snippet for it to the description. |
Actually, I'm hoping I could hijack this proposal a bit and suggest a sort of an upgrade. The proposed usage here is via animations and Regarding |
We are manually syncing the video.currentTime with scroll-timelines when we need to sync videos to scroll, so |
Is there any chance this can be extended to include animated images (like GIFs)? 😅 |
This is basically the current method: https://codepen.io/ydaniv/pen/VwNraKB?editors=0010, just for reference.
It's not so much about buffering, like in the example above, I think it's more about how you compress your video in terms of I, B, and P frames, so that when the browser seeks between frames it appears to be smooth. |
Yeah. Currently we compress videos specifically for scrubbing, but this increases the size of the videos. As you say, hopefully browsers can take the ‘video-timeline’ as a hint to process the video |
@ydaniv I don't think hijacking this issue for VideoTimeline is a good idea. It has come up on multiple issues and deserves its own issue for discussion, I've opened #11611 for this. If there are reasons that implementing |
Right, for sure. My intent was mostly to try and suggest adopting a more direct and rich interface for controlling the playback by using something like the
That's exciting! Thanks for opening. |
There are many sites which pause offscreen videos and unpause them when onscreen. Similarly sometimes the playback of videos is coordinated with animations. What if we could coordinate this without javascript.
Proposal: Add
video-play-state: auto | paused
similar toanimation-play-state
This would allow a simple animation to pause offscreen videos:
Play videos on hover:
Or similarly, if you had an animation that required the coordination of multiple videos you could make them start playing at the appropriate time in the animation, e.g.
We could also consider using video-play-state as an alternative to setting the autoplay attribute, e.g.
video-play-state: playing
could request that the video be playing automatically just as autoplay does.The text was updated successfully, but these errors were encountered: