ampproject / ampproject/amp-react-prototype

Playability: imperative vs declarative control

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.