|
@@ -44,10 +44,12 @@ class CarServer {
|
|
|
} else if (data.type === 'startRTC') {
|
|
} else if (data.type === 'startRTC') {
|
|
|
this.startVideo()
|
|
this.startVideo()
|
|
|
} if (data.type === 'conctrl') {
|
|
} if (data.type === 'conctrl') {
|
|
|
- PWM.changPWM(data.conctrl)
|
|
|
|
|
|
|
+ const state = this.Peer.iceConnectionState;
|
|
|
|
|
+ if(state === 'connected') PWM.changPWM(data.conctrl);
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- console.log('msg error:', error);
|
|
|
|
|
|
|
+ console.log(error);
|
|
|
|
|
+ throw error
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -99,7 +101,8 @@ class CarServer {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- console.log('startvideo:', error)
|
|
|
|
|
|
|
+ console.log(error);
|
|
|
|
|
+ throw error
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|