Function RemoteAudioTrack

  • This component plays the audio track of a remote user with the playback device you specify.

    Parameters

    Returns null | Element

    Example

    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} />
    ))}
    </>
    );
    }