ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
125 stars 111 forks source link

In a P2P video call, switchMediaTracks is not working? #113

Closed technasir closed 4 years ago

technasir commented 4 years ago

Hi, In a peer to peer video call, when i use below code to to switch my video camera, this.session .switchMediaTracks(constraints) .then(stream => { this.setState({localStream: stream}) }) .catch(error => {});

ccvlad commented 4 years ago

For React Native we use this code (import ConnectyCube from 'react-native-connectycube'): https://github.com/ConnectyCube/connectycube-reactnative-samples/blob/master/RNVideoChat/src/services/call-service.js#L94 The switchMediaTracks is used for other JS projects (import ConnectyCube from 'connectycube'). We use one codebase for all platforms (JS, NodeJS, Cordova, React Native, NativeScript). I see that we have not docs for the switch cameras in RN. We will add. Thank you!

technasir commented 4 years ago

There is also this line of code that is used in the connectycube react native code sample that i can't find in the docs: https://github.com/ConnectyCube/connectycube-reactnative-samples/blob/b318570a0e5ceef521d8234b9f22fac23ee6f842/RNVideoChat/src/services/call-service.js#L75 Please add information about this too in the docs.

ccvlad commented 4 years ago

There is also this line of code that is used in the connectycube react native code sample that i can't find in the docs: https://github.com/ConnectyCube/connectycube-reactnative-samples/blob/b318570a0e5ceef521d8234b9f22fac23ee6f842/RNVideoChat/src/services/call-service.js#L75

Please add information about this too in the docs.

// clear a WebRTC session by ID
clearSession(sessionId) {
  delete this.sessions[sessionId];
}
ccvlad commented 4 years ago

Closed. Create a separate issue for a new question/problem if need.