Whether it is ready to create the track. The default value is true.
Screen-sharing video configuration, including encoding and capturing configurations.
Whether to share the audio of the screen-sharing input source during screen sharing. Supported values are "enable", "disable", and "auto". See the parameters of createScreenVideoTrack for details.
import { AgoraRTCScreenShareProvider, LocalVideoTrack, useLocalScreenTrack } from "agora-rtc-react";
function App() {
const { screenTrack, error } = useLocalScreenTrack(screenShareOn, {}, "disable");
return (
<AgoraRTCScreenShareProvider client={client}>
<LocalVideoTrack play style={{ width: "300px", height: "300px" }} track={screenTrack} />
</AgoraRTCScreenShareProvider>
);
}
This hook lets you create a local video track for screen-sharing. This hook can only create the video track once before the component is destroyed. After the component is unmounted, the video track created by this hook stops publishing.