The list of local tracks.
Whether the local tracks are ready to publish. The default value is true
.
Optional
client: IAgoraRTCClientCreated using the Web SDK's IAgoraRTC.createClient
method.
import { useLocalMicrophoneTrack, useLocalCameraTrack, usePublish } from "agora-rtc-react";
function App() {
// get audioTrack and videoTrack before publish
const audioTrack = useLocalMicrophoneTrack();
const videoTrack = useLocalCameraTrack();
usePublish([audioTrack, videoTrack]);
return <></>;
}
This hook lets you publish the local tracks when the component is ready and unpublish them when the component is unmounted.