/WebRTC-ReactNative-to-Browser

Connection between React Native and Browser through react-native-webrtc library.

Primary LanguageJavaScript

React Native Configuration

  1. Navigate to the react folder.

  2. In the terminal, run the following command to download the project's dependencies:

yarn

  1. Now, with the device connected, execute the command:

yarn android

  1. With the application running, access the react/App.js file and, on line 60, replace the ip with your local ip , without changing port 4000.

  2. In the running application, click on the "START TRANSMISSION" button. The image from your camera should cover the entire screen.

Socket Configuration (port 4000)

  1. Browse to the server-js folder.

  2. In the terminal, run the following command to download the project's dependencies:

npm install

  1. Now, execute the following command to start the socket:

node index.js

  1. If everything works out, the message Server running on port 4000 should appear without any errors.

Browser Configuration

  1. Navigate to the browser folder.

  2. In the index.html file, on line 30, replace the ip with your local ip, without changing port 4000.

  3. The Chrome browser must be opened (make sure you have it on your computer) and then the camera image of the device where the React Native application is running is displayed.