Skip to main content

播放()v4.0.287

🌐 play()v4.0.287

在 Remotion Studio 中开始播放。

🌐 Starts playback in the Remotion Studio.

该函数接受一个可选的事件参数,该参数可以是 React.SyntheticEventPointerEvent。这允许该函数直接用作事件处理程序。

🌐 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 click
import {play} from '@remotion/studio'; const PlayButton = () => { // Call with the event parameter for better browser audio autoplay return <button onClick={(e) => play(e)}>Play</button>; };
Start playing programmatically
import {play} from '@remotion/studio'; // Call without event parameter play();

另请参阅

🌐 See also