@observertc/observer-js 0.30.6-beta → 0.40.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ObservedCall.d.ts +6 -12
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +24 -104
- package/lib/ObservedClient.d.ts +16 -32
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +381 -521
- package/lib/ObservedDataChannel.d.ts +68 -0
- package/lib/ObservedDataChannel.d.ts.map +1 -0
- package/lib/ObservedDataChannel.js +110 -0
- package/lib/ObservedInboundTrack.d.ts +3 -9
- package/lib/ObservedInboundTrack.d.ts.map +1 -1
- package/lib/ObservedInboundTrack.js +75 -157
- package/lib/ObservedOutboundTrack.d.ts +9 -9
- package/lib/ObservedOutboundTrack.d.ts.map +1 -1
- package/lib/ObservedOutboundTrack.js +77 -133
- package/lib/ObservedPeerConnection.d.ts +21 -15
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +85 -171
- package/lib/ObservedSfu.d.ts +5 -7
- package/lib/ObservedSfu.d.ts.map +1 -1
- package/lib/ObservedSfu.js +10 -74
- package/lib/Observer.d.ts +5 -6
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +28 -31
- package/lib/common/types.d.ts +0 -55
- package/lib/common/types.d.ts.map +1 -1
- package/lib/index.d.ts +5 -7
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ObservedCall.ts +27 -87
- package/src/ObservedClient.ts +451 -586
- package/src/ObservedDataChannel.ts +186 -0
- package/src/ObservedInboundTrack.ts +18 -72
- package/src/ObservedOutboundTrack.ts +36 -60
- package/src/ObservedPeerConnection.ts +79 -112
- package/src/ObservedSfu.ts +11 -46
- package/src/Observer.ts +11 -16
- package/src/common/types.ts +0 -69
- package/src/index.ts +5 -7
- package/lib/models/Models.d.ts +0 -642
- package/lib/models/Models.d.ts.map +0 -1
- package/lib/models/Models.js +0 -481
- package/lib/models/samples_pb.d.ts +0 -2452
- package/lib/models/samples_pb.d.ts.map +0 -1
- package/lib/models/samples_pb.js +0 -1495
- package/lib/storages/ObserverStorage.d.ts +0 -87
- package/lib/storages/ObserverStorage.d.ts.map +0 -1
- package/lib/storages/ObserverStorage.js +0 -2
- package/lib/storages/SimpleStorage.d.ts +0 -19
- package/lib/storages/SimpleStorage.d.ts.map +0 -1
- package/lib/storages/SimpleStorage.js +0 -106
- package/lib/storages/StorageProvider.d.ts +0 -16
- package/lib/storages/StorageProvider.d.ts.map +0 -1
- package/lib/storages/StorageProvider.js +0 -29
- package/src/models/Models.ts +0 -1103
- package/src/models/samples_pb.ts +0 -4061
- package/src/storages/ObserverStorage.ts +0 -99
- package/src/storages/SimpleStorage.ts +0 -120
- package/src/storages/StorageProvider.ts +0 -42
|
@@ -1,66 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
3
|
exports.ObservedOutboundTrack = void 0;
|
|
36
4
|
const events_1 = require("events");
|
|
37
|
-
const Models = __importStar(require("./models/Models"));
|
|
38
|
-
const SingleExecutor_1 = require("./common/SingleExecutor");
|
|
39
5
|
class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
40
|
-
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const model = new Models.OutboundTrack({
|
|
43
|
-
serviceId: peerConnection.client.serviceId,
|
|
44
|
-
roomId: peerConnection.client.roomId,
|
|
45
|
-
callId: peerConnection.client.callId,
|
|
46
|
-
clientId: peerConnection.client.clientId,
|
|
47
|
-
mediaUnitId: peerConnection.client.mediaUnitId,
|
|
48
|
-
peerConnectionId: peerConnection.peerConnectionId,
|
|
49
|
-
trackId: config.trackId,
|
|
50
|
-
kind: config.kind,
|
|
51
|
-
sfuStreamId: config.sfuStreamId,
|
|
52
|
-
});
|
|
53
|
-
const alreadyInserted = yield storageProvider.outboundTrackStorage.insert(config.trackId, model);
|
|
54
|
-
if (alreadyInserted)
|
|
55
|
-
throw new Error(`OutboundAudioTrack with id ${config.trackId} already exists`);
|
|
56
|
-
return new ObservedOutboundTrack(model, peerConnection, storageProvider);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
constructor(_model, peerConnection, _storageProvider) {
|
|
6
|
+
constructor(_model, peerConnection) {
|
|
60
7
|
super();
|
|
61
8
|
this._model = _model;
|
|
62
9
|
this.peerConnection = peerConnection;
|
|
63
|
-
this.
|
|
10
|
+
this.created = Date.now();
|
|
64
11
|
this.bitrate = 0;
|
|
65
12
|
this.totalLostPackets = 0;
|
|
66
13
|
this.totalSentPackets = 0;
|
|
@@ -71,19 +18,33 @@ class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
|
71
18
|
this.deltaSentBytes = 0;
|
|
72
19
|
this.deltaSentFrames = 0;
|
|
73
20
|
this.deltaEncodedFrames = 0;
|
|
74
|
-
this.created = Date.now();
|
|
75
21
|
this._stats = new Map();
|
|
76
|
-
this._execute = (0, SingleExecutor_1.createSingleExecutor)();
|
|
77
22
|
this._closed = false;
|
|
78
23
|
this._updated = Date.now();
|
|
79
24
|
this._remoteInboundTracks = new Map();
|
|
80
25
|
}
|
|
26
|
+
get serviceId() {
|
|
27
|
+
return this.peerConnection.serviceId;
|
|
28
|
+
}
|
|
29
|
+
get roomId() {
|
|
30
|
+
return this.peerConnection.roomId;
|
|
31
|
+
}
|
|
32
|
+
get callId() {
|
|
33
|
+
return this.peerConnection.callId;
|
|
34
|
+
}
|
|
35
|
+
get clientId() {
|
|
36
|
+
return this.peerConnection.clientId;
|
|
37
|
+
}
|
|
38
|
+
get mediaUnitId() {
|
|
39
|
+
return this.peerConnection.mediaUnitId;
|
|
40
|
+
}
|
|
41
|
+
get peerConnectionId() {
|
|
42
|
+
return this.peerConnection.peerConnectionId;
|
|
43
|
+
}
|
|
81
44
|
get kind() {
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
83
45
|
return this._model.kind;
|
|
84
46
|
}
|
|
85
47
|
get trackId() {
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
48
|
return this._model.trackId;
|
|
88
49
|
}
|
|
89
50
|
get sfuStreamId() {
|
|
@@ -101,9 +62,6 @@ class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
|
101
62
|
get stats() {
|
|
102
63
|
return this._stats;
|
|
103
64
|
}
|
|
104
|
-
get uptimeInMs() {
|
|
105
|
-
return this._updated - this.created;
|
|
106
|
-
}
|
|
107
65
|
get closed() {
|
|
108
66
|
return this._closed;
|
|
109
67
|
}
|
|
@@ -111,9 +69,7 @@ class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
|
111
69
|
if (this._closed)
|
|
112
70
|
return;
|
|
113
71
|
this._closed = true;
|
|
114
|
-
this.
|
|
115
|
-
.catch(() => void 0)
|
|
116
|
-
.finally(() => this.emit('close'));
|
|
72
|
+
this.emit('close');
|
|
117
73
|
}
|
|
118
74
|
resetMetrics() {
|
|
119
75
|
this.bitrate = 0;
|
|
@@ -126,69 +82,64 @@ class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
|
126
82
|
}
|
|
127
83
|
update(sample, timestamp) {
|
|
128
84
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.
|
|
174
|
-
|
|
175
|
-
return;
|
|
176
|
-
if (this.kind === 'audio')
|
|
177
|
-
this.peerConnection.client.call.sfuStreamIdToOutboundAudioTrack.delete(this._model.sfuStreamId);
|
|
178
|
-
else if (this.kind === 'video')
|
|
179
|
-
this.peerConnection.client.call.sfuStreamIdToOutboundVideoTrack.delete(this._model.sfuStreamId);
|
|
180
|
-
});
|
|
85
|
+
if (this._closed)
|
|
86
|
+
return;
|
|
87
|
+
const now = Date.now();
|
|
88
|
+
const report = Object.assign(Object.assign({ serviceId: this.peerConnection.client.serviceId, roomId: this.peerConnection.client.call.roomId, callId: this.peerConnection.client.call.callId, clientId: this.peerConnection.client.clientId, userId: this.peerConnection.client.userId, mediaUnitId: this.peerConnection.client.mediaUnitId, peerConnectionId: this.peerConnection.peerConnectionId }, sample), { timestamp, sampleSeq: -1 });
|
|
89
|
+
if (this.kind === 'audio')
|
|
90
|
+
this.reports.addOutboundAudioTrackReport(report);
|
|
91
|
+
else if (this.kind === 'video')
|
|
92
|
+
this.reports.addOutboundVideoTrackReport(report);
|
|
93
|
+
const elapsedTimeInMs = Math.max(1, now - this._updated);
|
|
94
|
+
const lastStat = this._stats.get(sample.ssrc);
|
|
95
|
+
const rttInMs = sample.roundTripTime ? sample.roundTripTime * 1000 : undefined;
|
|
96
|
+
const bitrate = (((_a = sample.bytesSent) !== null && _a !== void 0 ? _a : 0) - ((_b = lastStat === null || lastStat === void 0 ? void 0 : lastStat.bytesSent) !== null && _b !== void 0 ? _b : 0)) * 8 / (elapsedTimeInMs / 1000);
|
|
97
|
+
const deltaLostPackets = ((_c = sample.packetsLost) !== null && _c !== void 0 ? _c : 0) - ((_d = lastStat === null || lastStat === void 0 ? void 0 : lastStat.packetsLost) !== null && _d !== void 0 ? _d : 0);
|
|
98
|
+
const deltaSentPackets = ((_e = sample.packetsSent) !== null && _e !== void 0 ? _e : 0) - ((_f = lastStat === null || lastStat === void 0 ? void 0 : lastStat.packetsSent) !== null && _f !== void 0 ? _f : 0);
|
|
99
|
+
const deltaSentBytes = ((_g = sample.bytesSent) !== null && _g !== void 0 ? _g : 0) - ((_h = lastStat === null || lastStat === void 0 ? void 0 : lastStat.bytesSent) !== null && _h !== void 0 ? _h : 0);
|
|
100
|
+
let deltaEncodedFrames;
|
|
101
|
+
let deltaSentFrames;
|
|
102
|
+
if (this.kind === 'video') {
|
|
103
|
+
const videoSample = sample;
|
|
104
|
+
const lastVideoStats = lastStat;
|
|
105
|
+
deltaEncodedFrames = ((_j = videoSample.framesEncoded) !== null && _j !== void 0 ? _j : 0) - ((_k = lastVideoStats === null || lastVideoStats === void 0 ? void 0 : lastVideoStats.framesEncoded) !== null && _k !== void 0 ? _k : 0);
|
|
106
|
+
deltaSentFrames = ((_l = videoSample.framesSent) !== null && _l !== void 0 ? _l : 0) - ((_m = lastVideoStats === null || lastVideoStats === void 0 ? void 0 : lastVideoStats.framesSent) !== null && _m !== void 0 ? _m : 0);
|
|
107
|
+
}
|
|
108
|
+
const stats = Object.assign(Object.assign({}, sample), { rttInMs,
|
|
109
|
+
bitrate, ssrc: sample.ssrc, deltaLostPackets,
|
|
110
|
+
deltaSentPackets,
|
|
111
|
+
deltaSentBytes,
|
|
112
|
+
deltaEncodedFrames,
|
|
113
|
+
deltaSentFrames });
|
|
114
|
+
this._stats.set(sample.ssrc, stats);
|
|
115
|
+
this.bitrate = [...this._stats.values()].reduce((acc, stat) => acc + stat.bitrate, 0);
|
|
116
|
+
this.rttInMs = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.rttInMs) !== null && _a !== void 0 ? _a : 0); }, 0) / (this._stats.size || 1);
|
|
117
|
+
this.totalLostPackets = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.packetsLost) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
118
|
+
this.totalSentPackets = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.packetsSent) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
119
|
+
this.totalSentBytes = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.bytesSent) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
120
|
+
this.deltaEncodedFrames = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.deltaEncodedFrames) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
121
|
+
this.deltaSentFrames = [...this._stats.values()].reduce((acc, stat) => { var _a; return acc + ((_a = stat.deltaSentFrames) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
122
|
+
this.deltaLostPackets = [...this._stats.values()].reduce((acc, stat) => acc + stat.deltaLostPackets, 0);
|
|
123
|
+
this.deltaSentPackets = [...this._stats.values()].reduce((acc, stat) => acc + stat.deltaSentPackets, 0);
|
|
124
|
+
this.deltaSentBytes = [...this._stats.values()].reduce((acc, stat) => acc + stat.deltaSentBytes, 0);
|
|
125
|
+
// setting up sfu connection as it is not always available at the first sample
|
|
126
|
+
if (sample.sfuStreamId && !this._model.sfuStreamId) {
|
|
127
|
+
this._model.sfuStreamId = sample.sfuStreamId;
|
|
128
|
+
this.once('close', () => {
|
|
129
|
+
if (!this._model.sfuStreamId)
|
|
130
|
+
return;
|
|
181
131
|
if (this.kind === 'audio')
|
|
182
|
-
this.peerConnection.client.call.sfuStreamIdToOutboundAudioTrack.
|
|
132
|
+
this.peerConnection.client.call.sfuStreamIdToOutboundAudioTrack.delete(this._model.sfuStreamId);
|
|
183
133
|
else if (this.kind === 'video')
|
|
184
|
-
this.peerConnection.client.call.sfuStreamIdToOutboundVideoTrack.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
134
|
+
this.peerConnection.client.call.sfuStreamIdToOutboundVideoTrack.delete(this._model.sfuStreamId);
|
|
135
|
+
});
|
|
136
|
+
if (this.kind === 'audio')
|
|
137
|
+
this.peerConnection.client.call.sfuStreamIdToOutboundAudioTrack.set(this._model.sfuStreamId, this);
|
|
138
|
+
else if (this.kind === 'video')
|
|
139
|
+
this.peerConnection.client.call.sfuStreamIdToOutboundVideoTrack.set(this._model.sfuStreamId, this);
|
|
140
|
+
}
|
|
141
|
+
this._updated = now;
|
|
142
|
+
this.emit('update');
|
|
192
143
|
}
|
|
193
144
|
connectInboundTrack(track) {
|
|
194
145
|
if (this._closed)
|
|
@@ -199,12 +150,5 @@ class ObservedOutboundTrack extends events_1.EventEmitter {
|
|
|
199
150
|
});
|
|
200
151
|
this._remoteInboundTracks.set(track.trackId, track);
|
|
201
152
|
}
|
|
202
|
-
_save() {
|
|
203
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
-
if (this._closed)
|
|
205
|
-
throw new Error(`OutboundTrack ${this.trackId} is closed`);
|
|
206
|
-
return this._storageProvider.outboundTrackStorage.set(this.trackId, this._model);
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
153
|
}
|
|
210
154
|
exports.ObservedOutboundTrack = ObservedOutboundTrack;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { StorageProvider } from './storages/StorageProvider';
|
|
4
3
|
import { PeerConnectionTransport } from '@observertc/sample-schemas-js';
|
|
5
4
|
import { ObservedClient } from './ObservedClient';
|
|
6
|
-
import { ObservedInboundTrack,
|
|
7
|
-
import { ObservedOutboundTrack,
|
|
5
|
+
import { ObservedInboundTrack, ObservedInboundTrackModel } from './ObservedInboundTrack';
|
|
6
|
+
import { ObservedOutboundTrack, ObservedOutboundTrackModel } from './ObservedOutboundTrack';
|
|
8
7
|
import { ObservedICE } from './ObservedICE';
|
|
8
|
+
import { ObservedDataChannel } from './ObservedDataChannel';
|
|
9
9
|
export type ObservedPeerConnectionEvents = {
|
|
10
10
|
update: [];
|
|
11
11
|
close: [];
|
|
@@ -14,8 +14,9 @@ export type ObservedPeerConnectionEvents = {
|
|
|
14
14
|
newoutboundaudiotrack: [ObservedOutboundTrack<'audio'>];
|
|
15
15
|
newoutboundvideotrack: [ObservedOutboundTrack<'video'>];
|
|
16
16
|
};
|
|
17
|
-
export type
|
|
17
|
+
export type ObservedPeerConnectionModel = {
|
|
18
18
|
peerConnectionId: string;
|
|
19
|
+
label?: string;
|
|
19
20
|
};
|
|
20
21
|
export type ObservedPeerConnectionStats = Omit<PeerConnectionTransport, 'transportId' | 'label'>;
|
|
21
22
|
export declare interface ObservedPeerConnection {
|
|
@@ -27,9 +28,7 @@ export declare interface ObservedPeerConnection {
|
|
|
27
28
|
export declare class ObservedPeerConnection extends EventEmitter {
|
|
28
29
|
private readonly _model;
|
|
29
30
|
readonly client: ObservedClient;
|
|
30
|
-
|
|
31
|
-
static create(config: ObservedPeerConnectionConfig, client: ObservedClient, storageProvider: StorageProvider): Promise<ObservedPeerConnection>;
|
|
32
|
-
created: number;
|
|
31
|
+
readonly created: number;
|
|
33
32
|
totalInboundPacketsLost: number;
|
|
34
33
|
totalInboundPacketsReceived: number;
|
|
35
34
|
totalOutboundPacketsSent: number;
|
|
@@ -69,9 +68,15 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
69
68
|
private readonly _inboundVideoTracks;
|
|
70
69
|
private readonly _outboundAudioTracks;
|
|
71
70
|
private readonly _outboundVideoTracks;
|
|
72
|
-
private readonly
|
|
73
|
-
|
|
71
|
+
private readonly _dataChannels;
|
|
72
|
+
constructor(_model: ObservedPeerConnectionModel, client: ObservedClient);
|
|
73
|
+
get serviceId(): string;
|
|
74
|
+
get roomId(): string;
|
|
75
|
+
get callId(): string;
|
|
76
|
+
get clientId(): string;
|
|
77
|
+
get mediaUnitId(): string;
|
|
74
78
|
get label(): string | undefined;
|
|
79
|
+
set label(value: string | undefined);
|
|
75
80
|
get usingTURN(): boolean;
|
|
76
81
|
get availableOutgoingBitrate(): number | undefined;
|
|
77
82
|
get availableIncomingBitrate(): number | undefined;
|
|
@@ -83,17 +88,18 @@ export declare class ObservedPeerConnection extends EventEmitter {
|
|
|
83
88
|
get inboundVideoTracks(): ReadonlyMap<string, ObservedInboundTrack<'video'>>;
|
|
84
89
|
get outboundAudioTracks(): ReadonlyMap<string, ObservedOutboundTrack<'audio'>>;
|
|
85
90
|
get outboundVideoTracks(): ReadonlyMap<string, ObservedOutboundTrack<'video'>>;
|
|
91
|
+
get dataChannels(): ReadonlyMap<number, ObservedDataChannel>;
|
|
86
92
|
get uptimeInMs(): number;
|
|
87
93
|
get closed(): boolean;
|
|
88
94
|
close(): void;
|
|
89
95
|
getTrack(trackId: string): ObservedInboundTrack<'audio'> | ObservedInboundTrack<'video'> | ObservedOutboundTrack<'audio'> | ObservedOutboundTrack<'video'> | undefined;
|
|
90
96
|
resetMetrics(): void;
|
|
91
97
|
updateMetrics(): void;
|
|
92
|
-
update(sample: PeerConnectionTransport, timestamp: number):
|
|
93
|
-
createInboundAudioTrack(config: Omit<
|
|
94
|
-
createInboundVideoTrack(config: Omit<
|
|
95
|
-
createOutboundAudioTrack(config: Omit<
|
|
96
|
-
createOutboundVideoTrack(config: Omit<
|
|
97
|
-
|
|
98
|
+
update(sample: PeerConnectionTransport, timestamp: number): void;
|
|
99
|
+
createInboundAudioTrack(config: Omit<ObservedInboundTrackModel<'audio'>, 'kind'>): ObservedInboundTrack<'audio'>;
|
|
100
|
+
createInboundVideoTrack(config: Omit<ObservedInboundTrackModel<'video'>, 'kind'>): ObservedInboundTrack<'video'>;
|
|
101
|
+
createOutboundAudioTrack(config: Omit<ObservedOutboundTrackModel<'audio'>, 'kind'>): ObservedOutboundTrack<'audio'>;
|
|
102
|
+
createOutboundVideoTrack(config: Omit<ObservedOutboundTrackModel<'video'>, 'kind'>): ObservedOutboundTrack<'video'>;
|
|
103
|
+
createDataChannel(channelId: number): ObservedDataChannel;
|
|
98
104
|
}
|
|
99
105
|
//# sourceMappingURL=ObservedPeerConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedPeerConnection.d.ts","sourceRoot":"","sources":["../src/ObservedPeerConnection.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservedPeerConnection.d.ts","sourceRoot":"","sources":["../src/ObservedPeerConnection.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,4BAA4B,GAAG;IAC1C,MAAM,EAAE,EAAE,CAAC;IACX,KAAK,EAAE,EAAE,CAAC;IACV,mBAAmB,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,mBAAmB,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,qBAAqB,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,qBAAqB,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,uBAAuB,EAAE,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