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.
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 includingplayState
,play
,pause
, and other similar methods.