ampproject / ampproject/amp-react-prototype
Playability: imperative vs declarative control
Open
TBD
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
When an area of DOM (or component subtree) becomes unrendered or uninteractive, we need to pause relevant components. Otherwise the playback will continue and use will have no way of finding where it’s coming from and how to stop it.
For playability we can use `AmpContext` context properties.
For imperative/declarative control, playback is very difficult to support declaratively. This we can use `useImperativeHandle` and export playback API including `playState`, `play`, `pause`, and other similar methods.
Contributor guide
Assessment
This issue has not been assessed yet.