Skip to content

Commit

Permalink
Minor fixes. Switched to version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Jan 7, 2016
1 parent da4ab6e commit ccc1285
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ To use it:
## Link the library

```html
<script src="//cdn.webrtc-experiment.com/getStats.js"></script>
<script src="https://cdn.webrtc-experiment.com/getStats.js"></script>
```

Or link specific build:

* https://github.com/muaz-khan/getStats/releases

## window.getStats

To invoke directly:
Expand Down
15 changes: 9 additions & 6 deletions getStats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated at May 23, 2015, 08:32:23
// Last time updated at Jan 07, 2016, 08:32:23
// Latest file can be found here: https://cdn.webrtc-experiment.com/getStats.js
// Muaz Khan - www.MuazKhan.com
// MIT License - www.WebRTC-Experiment.com/licence
Expand All @@ -9,7 +9,7 @@
// cross-browser compatible solution
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-getstats
/*
getStats(function(result) {
getStats(rtcPeerConnection, function(result) {
result.connectionType.remote.ipAddress
result.connectionType.remote.candidateType
result.connectionType.transport
Expand All @@ -34,9 +34,12 @@ getStats(function(result) {

if (arguments[0] instanceof RTCPeerConnection) {
peer = arguments[0];
mediaStreamTrack = arguments[1];
callback = arguments[2];
interval = arguments[3];

if(!!navigator.mozGetUserMedia) {
mediaStreamTrack = arguments[1];
callback = arguments[2];
interval = arguments[3];
}

if (!(mediaStreamTrack instanceof MediaStreamTrack) && !!navigator.mozGetUserMedia) {
throw '2nd argument is not instance of MediaStreamTrack.';
Expand Down Expand Up @@ -210,4 +213,4 @@ getStats(function(result) {
if(typeof window !== 'undefined') {
window.getStats = getStats;
}
})();
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "getstats",
"preferGlobal": true,
"version": "1.0.2",
"version": "1.0.3",
"author": {
"name": "Muaz Khan",
"email": "[email protected]",
Expand Down

0 comments on commit ccc1285

Please sign in to comment.