everyone! I'm trying to learn javascript and webrtc using nodejs. I follow the tutorial of google code lab in this link https://codelabs.developers.google.com/codelabs/webrtc-web/#6. The source code is here https://github.com/googlecodelabs/webrtc-web/tree/master/step-05. Every thing is fine, but now I want to try to see if it works on the Internet. I learned to deploy the web on Heroku. https://simple-videochat-test.herokuapp.com/. But I received this error:
Access to XMLHttpRequest at 'https://computeengineondemand.appspot.com/turn?username=41784574&key=4080218913' from origin 'https://simple-videochat-test.herokuapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
I checked and it turned out the server doesn't work anymore. So I tried to add another turn server currently working for apprtc in this code to the main.js file:
var pcConfig = {
'iceServers': [
{
'urls': 'stun:stun.l.google.com:19302'
},
{
'urls': 'turn:192.158.29.39:3478?transport=udp',
'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
'username': '28224511:1379330808'
},
{
'urls': 'turn:192.158.29.39:3478?transport=tcp',
'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
'username': '28224511:1379330808'
}
]
};
The package.json for nodejs is below:
{
"name": "webrtc-codelab",
"version": "0.0.1",
"description": "WebRTC codelab",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"node-static": "^0.7.10",
"socket.io": "^2.0.4"
}
}
I can see the client receive message from each other but there is no video display. Can anyone help me here? Sorry for my English if it's bad. I'm not a native speaker. Thanks