useStartVideo
In some browsers to start video playback in low power mode, the user must perform a user-initiated event such as clicking a button. The useStartVideo
hook returns an object with a boolean canPlayVideo
flag that indicates whether video playback is allowed in the current context, as well as a startVideo
function that can be called in a button onClick
callback to start video playback in the current context.
Import
import { useStartVideo } from "@livekit/components-react";
Properties
props
React.ButtonHTMLAttributes<HTMLButtonElement>
room?
Room
Returns
{mergedProps: React.ButtonHTMLAttributes<HTMLButtonElement> & {className: string;onClick: () => void;style: {display: string;};};canPlayVideo: boolean;}