play()v4.0.287
Starts playback in the Remotion Studio.
The function accepts an optional event parameter which can be a React.SyntheticEvent
or a PointerEvent
. This allows the function to be used directly as an event handler.
Examples
Start playing on button clicktsx
import {play } from '@remotion/studio';constPlayButton = () => {// Call with the event parameter for better browser audio autoplayreturn <button onClick ={(e ) =>play (e )}>Play</button >;};
Start playing programmaticallytsx
import {play } from '@remotion/studio';// Call without event parameterplay ();