import { RemoteAudioTrack, useJoin, useRemoteAudioTracks, useRemoteUsers } from "agora-rtc-react";
function App() {
const remoteUsers = useRemoteUsers();
const audioTracks = useRemoteAudioTracks(remoteUsers);
return (
<>
{audioTracks.map(track => (
<RemoteAudioTrack key={track.getUserId()} play track={track} />
))}
</>
);
}
This component plays the audio track of a remote user with the playback device you specify.