Skip to content

Commit

Permalink
Spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
onel committed Apr 20, 2019
1 parent 21f3f88 commit 1aa78d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,31 @@ npm install @peermetrics/webrtc-stats
```

## Usage
### Loding the module
### Loading the module
WebRTC Stats can be loaded as an ES6 module, node module or directly in the browser.

After loading the module, initialize it.
*See [Options](#options) for all the initalize options*
*See [Options](#options) for all the initialize options*
```js
let stats = new WebRTCStats({
getStatsInterval: 5000
})
```
Add events listeners on the to listen to the `stats` event:
Add event listeners for `stats`:
```js
stats.on('stats', (ev) => {
console.log('stats', ev)
})
```
Use the `stats` object to add peers to the list to monitor:
Use `addPeer` to add peers to the list of monitored peers:
```js
let pc1 = new Peer({...})
stats.addPeer({
pc: pc1,
peerId: '1' # any string/int that helps you identify this peer
})
```
Now every `5000` ms WebRTC Stats will fire the `stats` event that will come with and object has the option
Now every `5000` ms WebRTC Stats will fire the `stats` event which will come with the object:
```js
{
event: 'stats',
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
"repository": "https://github.com/peermetrics/webrtc-stats",
"author": "Andrei Onel <andrei@peermetrics.io>",
"license": "MIT",
"keywords": [],
"keywords": [
"webrtc",
"webrtc-stats",
"stats"
],
"scripts": {
"build": "rollup -c && npm run copy",
"serve": "npm run build && http-server dist",
Expand Down

0 comments on commit 1aa78d3

Please sign in to comment.