open-webrtc-toolkit / owt-client-javascript

Open WebRTC Toolkit JavaScript SDK
https://01.org/open-webrtc-toolkit
Apache License 2.0
207 stars 124 forks source link

Failed to construct 'peerconnection', cannot create so many peerconnections #324

Open ghost opened 4 years ago

ghost commented 4 years ago

Failed to construct 'peerconnection', cannot create so many peerconnections

Scene:

When the browser client constantly switches the resolution and subscribes again, the created peerconnection seems to have never been released, but I explicitly called the publication. Stop () method.   This problem causes too many peerconnections to re subscribe to new streams;

Help to look at this problem. Thank you

jianjunz commented 4 years ago

There is a limitation of the max number of PeerConnections. Please try applyOptions if you want to update resolution.

kurapatijayaram commented 4 years ago

Hi @jianjunz , Even I faced this problem recently. When I connected to multiple rooms at different timings using the same browser and tab, end of the day when I tried to connect another room, this error occurred, when I closed the tab and reopened in another tab it worked. In my application, I used to subscribe to the stream whenever it is visible in the UI/whenever it is required, so subscribing and unsubscribing the streams will happen frequently, this practice will cause this error frequently ??

Please help.

Thank you.