-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for RTCPeerConnection.getStats() #163
Conversation
@ibc what kind of documentation to you need? |
Please consider this pull request. We use getStats to determine connection health for users, and would like to do the same for iOS users. |
@@ -584,6 +587,84 @@ RTCPeerConnection.prototype.createDataChannel = function (label, options) { | |||
return new RTCDataChannel(this, label, options); | |||
}; | |||
|
|||
RTCPeerConnection.prototype.getStats = function () { | |||
var self = this, | |||
isPromise, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inconsistent with the rest of the plugin. IMHO the switch to promises should happen all at once in a major release, say 4.0. So IMHO I'd just have the callback API here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the APIs in RTCPeerConnection.js are using promises already (look at setLocalDescription for example), what do you mean by being inconsistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I had a brain meltdown there. Disregard that comment.
@saghul I commented your inlines. In relation to the expected data, this comes directly from the WebRTC library. I didn't put what are the results, same way i don't know the results in chrome until i try the API call. |
You don't need to document every single option there, just showing an example and a link pointing to some reference should be enough). Is it really that hard to call the API once and show and example of its output? Following your reasoning, why document anything at all? Users can just try the API calls and see what happens. |
Sorry, time for holidays. I will handle this PR on my return. |
This PR implements the RTCPeerConnection.getStats() as per the RFC.