播放()v4.0.287
🌐 play()v4.0.287
在 Remotion Studio 中开始播放。
🌐 Starts playback in the Remotion Studio.
该函数接受一个可选的事件参数,该参数可以是 React.SyntheticEvent 或 PointerEvent。这允许该函数直接用作事件处理程序。
🌐 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 clickimport {play } from '@remotion/studio'; constPlayButton = () => { // Call with the event parameter for better browser audio autoplay return <button onClick ={(e ) =>play (e )}>Play</button >; };
Start playing programmaticallyimport {play } from '@remotion/studio'; // Call without event parameterplay ();
另请参阅
🌐 See also