Small example on how to use WebRTC with TypeScript and Angular 2 to build a small video chat. Only runs in a local network due to missing configured ICE server.
-
Navigate to
./backend
-
Install dependencies
$ npm install
-
Build server
$ npm run build
-
Start server on port 3000
$ npm start
-
Install Angular-CLI
-
Navigate to
./frontend
-
Serve with Angular-CLI
$ ng serve
- Currently no ICE servers are configured
- Therefor the project only runs on a local network.
- To use it from different devices inside your network,
you have to change the address, that the socket is using to connect to the backend.
The address can be found in the file
./frontend/src/app/webrtc-chat/shared/webrtc-client-connection.service.ts
- Angular-CLI can listen to all interfaces by using
ng serve --host 0.0.0.0
- Chrome uses deprecated API's of WebRTC due to the problem in webrtc/adapter #361
- Add ICE config
- Pretty up the whole thing :-)