DEV Community

Discussion on: Video call with WebRTC Angular and ASP.NET Core

Collapse
 
sebalr profile image
Sebastian Larrieu

Weird, try deleting node_modules and package.lock and run npm install again

Collapse
 
mammadkoma profile image
Mohammad Komaei

I did it. but it give us error :
D:\Projects\signalrtc-frontend-master>npm start

signal-rtc@0.0.0 start
ng serve

An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "D:\Projects\signalrtc-frontend-master".
See "C:\Users\MAMMAD~1\AppData\Local\Temp\ng-ggaBwX\angular-errors.log" for further details.
npm ERR! code 127
npm ERR! path D:\Projects\signalrtc-frontend-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c ng serve

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mammadkoma\AppData\Local\npm-cache_logs\2021-02-18T16_38_33_449Z-debug.log

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

after run npm update , it show this error now :
D:\Projects\signalrtc-frontend-master>npm start

signal-rtc@0.0.0 start
ng serve

Unknown error: SyntaxError: Unexpected token 'export'
npm ERR! code 127
npm ERR! path D:\Projects\signalrtc-frontend-master
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c ng serve

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mammadkoma\AppData\Local\npm-cache_logs\2021-02-18T16_48_13_596Z-debug.log

Thread Thread
 
sebalr profile image
Sebastian Larrieu

Install that dependency manually, maybe is missing from package.json

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

After update nodejs and npm and angular and change these packages version it started:
"@angular-devkit/build-angular": "~0.1102.1",
"@angular/cli": "~11.2.1",
"@angular/compiler-cli": "~11.2.1",
"@angular/language-service": "~11.0.7",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.2"

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

I Started angular by command prompt and SignalRtc.exe (in signalrtc-backend-master\bin\Debug\netcoreapp3.1)
chrome and edge asked me to access camera and microphone and I clicked allow.
Text sends but voice and video not.
(my camera light on my laptop is on now)

Thread Thread
 
sebalr profile image
Sebastian Larrieu

If text is working it means connection between peers has been stablished. I'm not sure what your problems could be, there is any log on console.?

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

text shows twice.
log in dotnetcore console :
Now listening on: localhost:5000
Now listening on: localhost:5001
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 OPTIONS localhost:5001/signalrtc/negotiate
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 36.3844ms 204
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST localhost:5001/signalrtc/negotiate text/plain;charset=UTF-8 0
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/signalrtc/negotiate'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/signalrtc/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 16.5687ms 200 application/json
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET localhost:5001/signalrtc?id=sHQhov...
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/signalrtc'
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 OPTIONS localhost:5001/signalrtc/negotiate
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 2.0513ms 204
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/2 POST localhost:5001/signalrtc/negotiate text/plain;charset=UTF-8 0
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/signalrtc/negotiate'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/signalrtc/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 2.5617ms 200 application/json
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET localhost:5001/signalrtc?id=LMcT0h...
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint '/signalrtc'

Thread Thread
 
sebalr profile image
Sebastian Larrieu

I was asking for browser console.
You need to create nicknames on differents browsers and then in one, and only one, browser select the other user

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

edge :
Uncaught TypeError: Cannot redefine property: BetterJsPop
at Function.defineProperty ()
at inject (:5:4295)
at :6:11
at :7:11
core.js:27701 Angular is running in development mode. Call enableProdMode() to enable production mode.
client:52 [WDS] Live Reloading enabled.
Utils.js:209 [2021-02-18T18:16:07.552Z] Information: WebSocket connected to wss://localhost:5001/signalrtc?id=LMcT0hNHw5mAjC1P3uc1nw.
signalr.service.ts:34 Connection started
app.component.ts:80 Can't join room, error NotReadableError: Could not start video source
(anonymous) @ app.component.ts:80
Utils.js:209 [2021-02-18T18:17:01.203Z] Information: WebSocket connected to wss://localhost:5001/signalrtc?id=A8Wi87etl-9F4qo6nh6EFw.
signalr.service.ts:34 Connection started
app.component.ts:80 Can't join room, error NotReadableError: Could not start video source
(anonymous) @ app.component.ts:80
Utils.js:203 [2021-02-18T18:19:11.011Z] Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 ().'.
push.yfcC.ConsoleLogger.log @ Utils.js:203
Utils.js:203 [2021-02-18T18:19:11.012Z] Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 ().'.
push.yfcC.ConsoleLogger.log @ Utils.js:203

chrome :
Uncaught TypeError: Cannot redefine property: BetterJsPop
at Function.defineProperty ()
at inject (:5:4295)
at :6:11
at :7:11
core.js:27701 Angular is running in development mode. Call enableProdMode() to enable production mode.
contentscript.js:58 ​…​​
client:52 [WDS] Live Reloading enabled.
Utils.js:209 [2021-02-18T18:16:00.238Z] Information: WebSocket connected to wss://localhost:5001/signalrtc?id=sHQhovh_QYbqS7kkCHzolw.
signalr.service.ts:34 Connection started
Utils.js:203 [2021-02-18T18:19:11.008Z] Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 ().'.

Thread Thread
 
sebalr profile image
Sebastian Larrieu

There is an error in the websoket connection as you could see in last line. You will have to Google that, it may be related to security in your browser

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

oops , I must click on a text in list , now I have see my video

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

but after publish back and front on a linux server it not working!

Thread Thread
 
sebalr profile image
Sebastian Larrieu

Is hard to tell without a little more context. In order to work you must have ssl on your servers. Also you may have to enable wss communication, it may be a nat error or any other things

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

After publish on windows server 2012 and iis 8 , error on chrome console :

WebSocket connection to 'ws://5.160.146.56/sockjs-node/182/aa2hoasq/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200
WebSocketBrowserDriver @ sockjs.js:1684
WebSocketTransport @ sockjs.js:2959
SockJS._connect @ sockjs.js:829
SockJS._receiveInfo @ sockjs.js:803
g @ sockjs.js:66
EventEmitter.emit @ sockjs.js:86
(anonymous) @ sockjs.js:567
g @ sockjs.js:66
EventEmitter.emit @ sockjs.js:86
(anonymous) @ sockjs.js:374
g @ sockjs.js:66
EventEmitter.emit @ sockjs.js:86
xhr.onreadystatechange @ sockjs.js:1598
wrapFn @ zone-evergreen.js:1218
invokeTask @ zone-evergreen.js:399
runTask @ zone-evergreen.js:167
invokeTask @ zone-evergreen.js:480
invokeTask @ zone-evergreen.js:1621
globalZoneAwareCallback @ zone-evergreen.js:1647
client:169 Invalid Host/Origin header
error @ client:169
(anonymous) @ socket.js:47
sock.onmessage @ SockJSClient.js:67
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:888
SockJS._transportMessage @ sockjs.js:886
EventEmitter.emit @ sockjs.js:86
(anonymous) @ sockjs.js:2203
EventEmitter.emit @ sockjs.js:86
(anonymous) @ sockjs.js:2148
EventEmitter.emit @ sockjs.js:86
EventSourceReceiver.es.onmessage @ sockjs.js:2251
client:172 [WDS] Disconnected!

Thread Thread
 
mammadkoma profile image
Mohammad Komaei

Publish on win server 2012 and iis 8 , chrome console :
WebSocket connection to 'ws://5.160.146.56/sockjs-node/182/aa2hoasq/websocket' failed: Error during WebSocket handshake: Unexpected response code: 200

client:169 Invalid Host/Origin header

client:172 [WDS] Disconnected!

Ok , Thanks I will add https and test it.

Some comments have been hidden by the post's author - find out more