genesys-cloud-streaming-client 18.0.0 → 18.0.1-master-to-develop.3
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/dist/cjs/client.js +1 -1
- package/dist/cjs/webrtc.d.ts +4 -1
- package/dist/cjs/webrtc.js +32 -7
- package/dist/deploy-info.json +5 -5
- package/dist/es/client.js +1 -1
- package/dist/es/index.bundle.js +1568 -777
- package/dist/es/webrtc.d.ts +4 -1
- package/dist/es/webrtc.js +32 -7
- package/dist/npm/CHANGELOG.md +6 -1
- package/dist/npm/client.js +1 -1
- package/dist/npm/webrtc.d.ts +4 -1
- package/dist/npm/webrtc.js +32 -7
- package/dist/streaming-client.browser.ie.js +6 -6
- package/dist/streaming-client.browser.js +5 -20
- package/dist/v18/streaming-client.browser.ie.js +6 -6
- package/dist/v18/streaming-client.browser.js +5 -20
- package/dist/v18.0.1/streaming-client.browser.ie.js +32 -0
- package/dist/v18.0.1/streaming-client.browser.js +17 -0
- package/package.json +120 -117
- package/dist/v18.0.0/streaming-client.browser.ie.js +0 -32
- package/dist/v18.0.0/streaming-client.browser.js +0 -32
package/dist/cjs/client.js
CHANGED
package/dist/cjs/webrtc.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import { IQ } from 'stanza/protocol';
|
|
4
|
+
import { LRUCache } from 'lru-cache';
|
|
4
5
|
import { SessionManager } from 'stanza/jingle';
|
|
5
6
|
import { SessionOpts } from 'stanza/jingle/Session';
|
|
6
7
|
import { Client } from './client';
|
|
@@ -19,7 +20,8 @@ export interface InitRtcSessionOptions {
|
|
|
19
20
|
}
|
|
20
21
|
export declare class WebrtcExtension extends EventEmitter implements StreamingClientExtension {
|
|
21
22
|
client: Client;
|
|
22
|
-
ignoredSessions:
|
|
23
|
+
ignoredSessions: LRUCache<string, boolean, unknown>;
|
|
24
|
+
private earlyIceCandidates;
|
|
23
25
|
logger: any;
|
|
24
26
|
pendingSessions: {
|
|
25
27
|
[sessionId: string]: IPendingSession;
|
|
@@ -47,6 +49,7 @@ export declare class WebrtcExtension extends EventEmitter implements StreamingCl
|
|
|
47
49
|
configureNewStanzaInstance(stanzaInstance: NamedAgent): Promise<void>;
|
|
48
50
|
private configureStanzaIceServers;
|
|
49
51
|
private handleGenesysOffer;
|
|
52
|
+
private applyEarlyIceCandidates;
|
|
50
53
|
private handleGenesysRenegotiate;
|
|
51
54
|
private handleGenesysIceCandidate;
|
|
52
55
|
private handleGenesysTerminate;
|
package/dist/cjs/webrtc.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.WebrtcExtension = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const events_1 = require("events");
|
|
6
6
|
const JID_1 = require("stanza/JID");
|
|
7
|
-
const lru_cache_1 =
|
|
7
|
+
const lru_cache_1 = require("lru-cache");
|
|
8
8
|
const Constants_1 = require("stanza/Constants");
|
|
9
9
|
const uuid_1 = require("uuid");
|
|
10
10
|
const lodash_throttle_1 = tslib_1.__importDefault(require("lodash.throttle"));
|
|
@@ -43,7 +43,11 @@ const ICE_SERVER_REFRESH_PERIOD = 1000 * 60 * 60 * 6; // 6 hours
|
|
|
43
43
|
class WebrtcExtension extends events_1.EventEmitter {
|
|
44
44
|
constructor(client, clientOptions) {
|
|
45
45
|
super();
|
|
46
|
-
|
|
46
|
+
// sessionId maps to boolean where `true` means the sessionId is ignored
|
|
47
|
+
this.ignoredSessions = new lru_cache_1.LRUCache({ max: 10, ttl: 10 * 60 * 60 * 6 });
|
|
48
|
+
// sessionId maps to a list of sdp ice candidates
|
|
49
|
+
// hold onto early candidates for 1 minute
|
|
50
|
+
this.earlyIceCandidates = new lru_cache_1.LRUCache({ max: 10, ttl: 1000 * 60, ttlAutopurge: true });
|
|
47
51
|
this.pendingSessions = {};
|
|
48
52
|
this.statsArr = [];
|
|
49
53
|
this.throttleSendStatsInterval = 25000;
|
|
@@ -197,9 +201,19 @@ class WebrtcExtension extends events_1.EventEmitter {
|
|
|
197
201
|
this.webrtcSessions = this.webrtcSessions.filter(s => s.id !== session.id);
|
|
198
202
|
});
|
|
199
203
|
this.webrtcSessions.push(session);
|
|
200
|
-
this.logger.info('emitting sdp media-session (offer
|
|
204
|
+
this.logger.info('emitting sdp media-session (offer');
|
|
205
|
+
this.applyEarlyIceCandidates(session);
|
|
201
206
|
return this.emit(events.INCOMING_RTCSESSION, session);
|
|
202
207
|
}
|
|
208
|
+
applyEarlyIceCandidates(session) {
|
|
209
|
+
const earlyCandidates = this.earlyIceCandidates.get(session.id);
|
|
210
|
+
if (earlyCandidates) {
|
|
211
|
+
this.earlyIceCandidates.delete(session.id);
|
|
212
|
+
for (const candidate of earlyCandidates) {
|
|
213
|
+
void session.addRemoteIceCandidate(candidate);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
203
217
|
async handleGenesysRenegotiate(existingSession, newSdp) {
|
|
204
218
|
await existingSession.peerConnection.setRemoteDescription({ sdp: newSdp, type: 'offer' });
|
|
205
219
|
await existingSession.accept();
|
|
@@ -207,8 +221,19 @@ class WebrtcExtension extends events_1.EventEmitter {
|
|
|
207
221
|
async handleGenesysIceCandidate(iq) {
|
|
208
222
|
const message = iq.genesysWebrtc;
|
|
209
223
|
const params = message.params;
|
|
210
|
-
const session = this.getSessionById(params.sessionId);
|
|
211
|
-
|
|
224
|
+
const session = this.getSessionById(params.sessionId, true);
|
|
225
|
+
if (session) {
|
|
226
|
+
await session.addRemoteIceCandidate(params.sdp);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
const earlyCandidates = this.earlyIceCandidates.get(params.sessionId);
|
|
230
|
+
if (earlyCandidates) {
|
|
231
|
+
this.earlyIceCandidates.set(params.sessionId, [...earlyCandidates, params.sdp]);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.earlyIceCandidates.set(params.sessionId, [params.sdp]);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
212
237
|
}
|
|
213
238
|
async handleGenesysTerminate(iq) {
|
|
214
239
|
const message = iq.genesysWebrtc;
|
|
@@ -216,9 +241,9 @@ class WebrtcExtension extends events_1.EventEmitter {
|
|
|
216
241
|
const session = this.getSessionById(params.sessionId);
|
|
217
242
|
session.onSessionTerminate(params.reason);
|
|
218
243
|
}
|
|
219
|
-
getSessionById(id) {
|
|
244
|
+
getSessionById(id, nullIfNotFound = false) {
|
|
220
245
|
const session = this.getAllSessions().find(session => session.id === id);
|
|
221
|
-
if (!session) {
|
|
246
|
+
if (!session && !nullIfNotFound) {
|
|
222
247
|
const error = new Error('Failed to find session by id');
|
|
223
248
|
this.logger.error(error, { sessionId: id });
|
|
224
249
|
throw error;
|
package/dist/deploy-info.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "developercenter-cdn/streaming-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "master-to-develop",
|
|
4
4
|
"ecosystem": "pc",
|
|
5
5
|
"team": "Client Streaming and Signaling",
|
|
6
6
|
"indexFiles": [
|
|
7
7
|
{
|
|
8
|
-
"file": "v18.0.
|
|
8
|
+
"file": "v18.0.1/streaming-client.browser.ie.js"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"file": "v18.0.
|
|
11
|
+
"file": "v18.0.1/streaming-client.browser.js"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"file": "v18/streaming-client.browser.ie.js"
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"file": "v18/streaming-client.browser.js"
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
|
-
"build": "
|
|
21
|
-
"buildDate": "2024-
|
|
20
|
+
"build": "3",
|
|
21
|
+
"buildDate": "2024-12-05T19:50:03.399273514Z"
|
|
22
22
|
}
|