Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
429 stars 100 forks source link

Error when using getStats in IE (Plugin 0.8.870) #204

Closed Lenne231 closed 8 years ago

Lenne231 commented 8 years ago

Hello,

i'm getting the following error when calling getStats in IE (Plugin 0.8.870)

Invalid argument conversion from class boost::shared_ptr<class FB::JSObject> to class TemWebRTC::TemMediaStreamTrack at index 1

peerConnection.getStats(function(response) { 
  response.result().forEach(function(report) { 
    report.names().forEach(function(name) { 
      console.log(name + ': ' + report.stat(name)); 
    }); 
  });
}, null, function(error) { console.log(error); });
johache commented 8 years ago

Hi, You are placing your arguments in the wrong order. See the spec for help :https://www.w3.org/TR/webrtc/#widl-RTCPeerConnection-getStats-void-MediaStreamTrack-selector-RTCStatsCallback-successCallback-RTCPeerConnectionErrorCallback-failureCallback

See also our getStats sample for a live example : https://plugin.temasys.com.sg/demo/src/content/peerconnection/constraints/

That should solve your problem, so I will close this ticket. Feel free to re-open if relevant.

Regards, J-O