We assume you have already deployed your backend. If not, please follow this tutorial to deploy your backend with outspeed-client.

The code shown establishes a peer connection with the backend and streams local audio to it.

  • We import necessary components from the @outspeed/react-native and @outspeed/core libraries.
  • useWebRTC: This hook is used to manage WebRTC connections. Visit here to learn more about useWebRTC.
  • The useWebRTC hook is set up with a URL (functionURL) and option to enable audio.
    • audioConstraints: {}: This selects the default audio input device and streams the audio to the backend. You can also specify any MediaTrackConstraints to customize the audio input.
  • Streaming: Using RealtimePlayer component to stream. Learn more about RealtimePlayer component here.

Resources