Update to use dev env and check rtcPeerConnection vefore addIceCandidate
This commit is contained in:
parent
3feb6c3f22
commit
7fc88198cb
16
src/App.js
16
src/App.js
@ -47,7 +47,7 @@ class App extends Component {
|
||||
|
||||
|
||||
handleLoginClick = async () => {
|
||||
const loginRequest = await fetch('http://localhost:41418/login', {
|
||||
const loginRequest = await fetch('https://dev.linx.safemobile.com/api/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
@ -60,7 +60,7 @@ class App extends Component {
|
||||
const loginResponseJson = await loginRequest.json();
|
||||
this.setState({ user: loginResponseJson.data }, () => {
|
||||
// Connect to HUB
|
||||
this.setState({ socket: io("ws://localhost:41414", {reconnect:true, transports: ['websocket']}) }, () => {
|
||||
this.setState({ socket: io("https://hub.dev.linx.safemobile.com/", {reconnect:true, transports: ['websocket']}) }, () => {
|
||||
const socket = this.state.socket;
|
||||
socket.on('connect', () => {
|
||||
this.setState({ hubStatus: 2 })
|
||||
@ -184,11 +184,13 @@ class App extends Component {
|
||||
}
|
||||
|
||||
if(parseDate.type === 'candidate') {
|
||||
const candidate = new RTCIceCandidate({
|
||||
sdpMLineIndex: parseDate.label,
|
||||
candidate: parseDate.candidate
|
||||
});
|
||||
this.state.rtcPeerConnection.addIceCandidate(candidate);
|
||||
if(this.state.rtcPeerConnection) {
|
||||
const candidate = new RTCIceCandidate({
|
||||
sdpMLineIndex: parseDate.label,
|
||||
candidate: parseDate.candidate
|
||||
});
|
||||
this.state.rtcPeerConnection.addIceCandidate(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user