DEV Community

loading...

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

Collapse
babakmou profile image
Babak

Hi,

Thanks for this post which helped me a lot in understanding webrtc. Could you please help me to solve below issue?
I also downgraded the version of Typescript from 4 to 3.5.3. , same as yours which didn't work.

Error: src/app/rtc.service.ts:31:5 - error TS2322: Type 'BehaviorSubject' is not assignable to type 'BehaviorSubject'.
Types of property 'observers' are incompatible.
Type 'Observer[]' is not assignable to type 'Observer[]'.
Type 'Observer' is not assignable to type 'Observer'.
Type 'UserInfo[]' is not assignable to type 'never[]'.

31     this.users = new BehaviorSubject([]);
Enter fullscreen mode Exit fullscreen mode
Collapse
sebalr profile image
Sebastian Larrieu Author • Edited

Is hard to tell without looking your code. You may have two differents versions of rxjs installed or you are importing behaviourSubject from the wrong place.
Or maybe something changes on RTC library and is returning something different

Collapse
babakmou profile image
Babak

It is exactly your code. I have made no changes,
There were some other errors which could be fixed. For example, I had to add type "any" for "data" as parameter of all peer.on() event listeners.

Thread Thread
sebalr profile image
Sebastian Larrieu Author • Edited

It may be related to some TS or Angular upgrade. Try changing the empty array param in line 31 to a new types empty array.
Instead of [] change to new Array with UserInfo as type between <<>>

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