Zemke / react-native-peerjs

PeerJS for React Native
55 stars 36 forks source link

call.on('stream', (stream) => ...) never fires after peer.call #34

Open made-by-jonny opened 2 years ago

made-by-jonny commented 2 years ago

I am working on a prototype and struggling to show the users stream back to the user once they have connected.

I can successfully call. const call = peer.call(connection, localStream); and the stream appears on the other device, but when I try and get the connected users stream by calling

call.on('stream', call => {
    setRemoteStream(call);
});

after it never seems to fire, I feel like I am missing something simple, but it feels like a bug as comparing it to the rest of the resources I have found on this topic show to do the above.

Package.json

{
  "name": "testproject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "17.0.2",
    "react-native": "0.66.4",
    "react-native-peerjs": "^1.0.4",
    "react-native-webrtc": "^1.94.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

I can upload a repo if needed, but I'm not doing anything out of the ordinary.

any helps would be great, thanks

roshangm1 commented 2 years ago

I am not even being able to connect to the peer server anymore. How did you mange to do that ?