DEV Community

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

Collapse
saravanakumar491993 profile image
saravanakumar491993 • Edited on

Dear Sebastian,

I'm able to connect with other user using singalr and hello is working. When I choose an user the following error occurs in Angular. Please help me with this.

ReferenceError: SimplePeer is not defined

Collapse
sebalr profile image
Sebastian Larrieu Author

Maybe you are not importing the library

Collapse
saravanakumar491993 profile image
saravanakumar491993 • Edited on

I did it in angular

npm install simple-peer
npm install @types/simple-peer

It only worked after i add the below script in index.html :(

<script src="https://cdnjs.cloudflare.com/ajax/libs/simple-peer/6.2.1/simplepeer.min.js"></script>

Why is that so. Please help.

Thread Thread
sebalr profile image
Sebastian Larrieu Author

You have to import simple peer in component ts. Check the GitHub

Thread Thread
saravanakumar491993 profile image
Info Comment hidden by post author - thread only visible in this permalink
saravanakumar491993

Love you dear sebastian. You are a genius and a humble person. Never seen a great person like you to respond to these kind of simple error that are made by fellow dev's like me. Huge appreciation for your reply. God bless you.

Collapse
timsar2 profile image
timsar2 • Edited on

import inside styles[] into angular.json file.

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