@testrtc/watchrtc-sdk
Advanced tools
Comparing version 1.30.4 to 1.30.5
import "./types"; | ||
import { IWatchRTCConfiguration, Rating } from "./interfaces"; | ||
import { IEvent, IWatchRTCConfiguration, Rating } from "./interfaces"; | ||
/** | ||
@@ -40,2 +40,4 @@ * Initialize SDK. Can be called multiple times but it will be initialized only at the first time. | ||
export declare const enableDataCollection: () => void; | ||
export declare const addEvent: (event: IEvent) => void; | ||
export declare const mapStream: (id: string, name: string) => void; | ||
declare const _default: { | ||
@@ -79,3 +81,5 @@ /** | ||
enableDataCollection: () => void; | ||
addEvent: (event: IEvent) => void; | ||
mapStream: (id: string, name: string) => void; | ||
}; | ||
export default _default; |
@@ -33,1 +33,7 @@ export interface RTCPeerConnectionInformation { | ||
export declare type Rating = 1 | 2 | 3 | 4 | 5; | ||
export declare type EventType = "global" | "local" | "log"; | ||
export interface IEvent { | ||
name: string; | ||
/** "global" or "local" or "log" */ | ||
type: EventType; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { IWatchRTCConfiguration, Rating } from "./interfaces"; | ||
import { IEvent, IWatchRTCConfiguration, Rating } from "./interfaces"; | ||
/** | ||
@@ -22,1 +22,3 @@ * Initialize SDK. | ||
export declare const enableDataCollection: () => void; | ||
export declare const addEvent: (event: IEvent) => void; | ||
export declare const mapStream: (id: string, name: string) => void; |
@@ -1,2 +0,2 @@ | ||
import { IWatchRTCConfiguration, IWatchrtcIdentifiers, Rating, RTCPeerConnectionInformation } from "./interfaces"; | ||
import { IEvent, IWatchRTCConfiguration, IWatchrtcIdentifiers, Rating, RTCPeerConnectionInformation } from "./interfaces"; | ||
export declare const logPrefix: (type?: "error" | "info") => string[]; | ||
@@ -20,2 +20,3 @@ export declare const deltaCompression: (oldStats: any, newStats: any) => any; | ||
export declare const validateRating: (rating: Rating) => boolean; | ||
export declare const validateEvent: (event: IEvent) => boolean; | ||
export declare const getHardwareInfo: () => Promise<any>; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.30.4"; | ||
declare const _default: "1.30.5"; | ||
export default _default; |
@@ -7,2 +7,3 @@ interface IWatchRTCSocketOptions { | ||
connection: WebSocket | null; | ||
wasConnected: boolean; | ||
private buffer; | ||
@@ -9,0 +10,0 @@ private sendInterval; |
{ | ||
"name": "@testrtc/watchrtc-sdk", | ||
"version": "1.30.4", | ||
"version": "1.30.5", | ||
"description": "Monitor your WebRTC application by collecting WebRTC statistics from end users", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -101,2 +101,4 @@ # watchRTC JS SDK | ||
You can call init() multiple times, but it will be initialized only at the first time. Following calls will be ignored. | ||
#### via watchRTC.setConfig() | ||
@@ -160,4 +162,27 @@ | ||
### Initialize SDK. Can be called multiple times but it will be initialized only at the first time. | ||
### Adding events | ||
You can add your own events to the graphs and event logs. This enables you to monitor specific activity that you are interested in that is outside the generic scope of how WebRTC operates but part of your application logic. This is done by calling `watchRTC.addEvent()`. Read more about [adding custom events in watchRTC](https://testrtc.com/docs/adding-custom-events-in-watchrtc/). | ||
- name - The event name. This will be displayed when the event occurred | ||
- type - One of the following event types | ||
- "log" - the event will appear only on the event log in the Advanced WebRTC Analytics for the peer | ||
- "local" - the event will be in the event log as well as placed on the peer level charts | ||
- "global" - the event will be in the event log, peer level charts and on the room level charts | ||
```javascript | ||
watchRTC.addEvent("Screen sharing", "global"); | ||
``` | ||
### Mapping streams | ||
By default, watchRTC will assign the SSRC information as the name for incoming channels. You can change these to human-readable format indicating the source of the channels by mapping their streams. This is done by calling `watchRTC.mapStream(')`. Read more about [mapping streams in watchRTC](https://testrtc.com/docs/mapping-streams-in-watchrtc/). | ||
- id - the StreamIdentifier to map from in the PeerConnection object | ||
- name - the human readable name to assign and display for it | ||
```javascript | ||
watchRTC.mapStream("lyk0zS1eyvZfJRLis3OIwBx3UvH3:oxrhEtb3sV7VutbQ:video", "User A"); | ||
``` | ||
## Samples | ||
@@ -182,3 +207,3 @@ | ||
- `watchRTC.addTags()` was deprecated. We no longer support tags. These have been replaced with a key/value system | ||
- `watchRTC.addKeys()` was added. Read more about [keys in watchRTC](https://testrtc.com/docs/using-custom-keys-in-watchrtc/). | ||
- `watchRTC.addKeys()` was added. Read more about [keys in watchRTC](https://testrtc.com/docs/using-custom-keys-in-watchrtc/) | ||
@@ -199,1 +224,11 @@ ### 1.30.2 (October 3, 2021) | ||
- Fixed a CSP warning by making the watchRTC SDK self-suficient without any external dependencies | ||
### 1.30.5 (November 19, 2021) | ||
#### New features | ||
- `watchRTC.mapStream()` was added. Read more about [mapping streams in watchRTC](https://testrtc.com/docs/mapping-streams-in-watchrtc/) | ||
- `watchRTC.addEvent()` was added. Read more about [events in watchRTC](https://testrtc.com/docs/adding-custom-events-in-watchrtc/) | ||
- icecandidateerror() events are now collected by the SDK | ||
- RTCRtpSender.setParameters() calls are now collected by the SDK | ||
- Added support for parameterless setLocalDescription() calls |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
438539
1841
231