stephenlb / webrtc-sdk

WebRTC Simple Calling API + Mobile SDK - A simplified approach to RTCPeerConnection for mobile and web video calling apps.
https://stephenlb.github.io/webrtc-sdk/
MIT License
855 stars 278 forks source link

Cannot read property 'number' of undefined #55

Closed baskin closed 5 years ago

baskin commented 6 years ago

Receive the following quite often in onicecandidate(). Seems there is no reference to "this" apart from the above method and it is null.

ERROR TypeError: Cannot read property 'number' of undefined
    at onicecandidate (webrtc-v2.js:411)
    at RTCPeerConnection.r (adapter_no_global.min.js:1)
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.js:4751)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at e.invokeTask [as invoke] (polyfills.js:3)
    at p (polyfills.js:2)
    at RTCPeerConnection.v (polyfills.js:2)
stephenlb commented 6 years ago

Good find! Will start looking into this.

stephenlb commented 6 years ago

If you want, the quick fix for you today is using the https://stephenlb.github.io/webrtc-sdk/js/webrtc.js instead of v2 for now. They have the same API and are backward compatible.

stephenlb commented 5 years ago

This may have been fixed in v2 with recent updates

stephenlb commented 5 years ago

We've submitted a much needed race condition patch this may work now as expected for you! 👍

stephenlb commented 5 years ago

Race was fixed.