-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,58 @@ | ||
CallStats for Android (WIP) | ||
=========================== | ||
Callstats WebRTC analytic library for Android | ||
|
||
## Demo | ||
The project contains demo application which connect to https://demo.callstats.io | ||
|
||
## TODO | ||
|
||
- [x] Authentication | ||
- [x] User Action Events | ||
- [x] Fabric Events | ||
- [x] Stats submission | ||
- [x] ICE Events | ||
- [x] Media Events | ||
- [x] Device Events | ||
- [x] Special Events | ||
- [x] Callstats Internal Events | ||
- [x] csioAvgRtt | ||
- [x] csioAvgJitter | ||
- [x] csioAvgBRKbps | ||
- [x] csioIntMs | ||
- [x] csioTimeElapseMs | ||
- [x] csioIntBRKbps | ||
- [x] csioIntFL | ||
- [x] csioIntPktLoss | ||
CallStats for Android | ||
===================== | ||
|
||
[](https://bintray.com/callstats-io/maven/callstats/_latestVersion) | ||
|
||
[Callstats](https://www.callstats.io/) WebRTC analytic library for Android. | ||
|
||
## Getting started | ||
### Gradle dependency | ||
|
||
``` | ||
implementation "io.callstats:callstats:<version>" | ||
``` | ||
|
||
Library will requires WebRTC library to be available at runtime. | ||
``` | ||
implementation "org.webrtc:google-webrtc:<version>" | ||
``` | ||
For more information https://webrtc.org/native-code/android/ | ||
|
||
### Create Callstats object | ||
```kotlin | ||
callstats = Callstats( | ||
context, | ||
appID, // Application ID from Callstats | ||
localID, // current user ID | ||
deviceID, // unique device ID | ||
jwt, // jwt from server for authentication | ||
alias) // (Optional) user alias | ||
``` | ||
|
||
### Send events | ||
When starting the call, call `startSession` with room identifier | ||
```kotlin | ||
callstats.startSession(room) | ||
``` | ||
|
||
These events need to be forwarded to the library in order to start tracking the call. Add followings into your WebRTC `PeerConnection.Observer` For example: | ||
```kotlin | ||
override fun onIceConnectionChange(state: PeerConnection.IceConnectionState) { | ||
callstats.reportEvent(peerId, OnIceConnectionChange(state)) | ||
} | ||
|
||
override fun onIceGatheringChange(state: PeerConnection.IceGatheringState) { | ||
callstats.reportEvent(peerId, OnIceGatheringChange(state)) | ||
} | ||
|
||
override fun onSignalingChange(state: PeerConnection.SignalingState) { | ||
callstats.reportEvent(peerId, OnSignalingChange(state)) | ||
} | ||
``` | ||
|
||
And when call finished | ||
``` kotlin | ||
callstats.stopSession() | ||
``` | ||
|
||
You can take a look at how to send more events in demo application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters