@opentok/client 2.28.4-alpha.17 → 2.28.4-alpha.19

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.
@@ -268,6 +268,85 @@ declare namespace OT {
268
268
  context?: object
269
269
  ): void;
270
270
  }
271
+
272
+ // This class is a modified copy of OTEventEmitter that was needed in order to support the template string used for the signal:type event
273
+ class SessionOTEventEmitter<EventMap> {
274
+ on<EventName extends keyof EventMap>(
275
+ eventName: EventName,
276
+ callback: (event: EventMap[EventName]) => void,
277
+ context?: object
278
+ ): void;
279
+
280
+ on(
281
+ eventName: `signal:${string}`,
282
+ callback: (event: Event<`signal:${string}`, Session> & {
283
+ type?: string;
284
+ data?: string;
285
+ from: Connection | null;
286
+ }) => void,
287
+ context?: object
288
+ ): void;
289
+
290
+ on(
291
+ eventName: string,
292
+ callback: (event: Event<string, any>) => void,
293
+ context?: object
294
+ ): void;
295
+
296
+ on(
297
+ eventMap: object,
298
+ context?: object
299
+ ): void;
300
+
301
+ once<EventName extends keyof EventMap>(
302
+ eventName: EventName,
303
+ callback: (event: EventMap[EventName]) => void,
304
+ context?: object
305
+ ): void;
306
+
307
+ once(
308
+ eventName: `signal:${string}`,
309
+ callback: (event: Event<`signal:${string}`, Session> & {
310
+ type?: string;
311
+ data?: string;
312
+ from: Connection | null;
313
+ }) => void,
314
+ context?: object
315
+ ): void;
316
+
317
+ once(
318
+ eventName: string,
319
+ callback: (event: Event<string, any>) => void,
320
+ context?: object
321
+ ): void;
322
+
323
+ once(
324
+ eventMap: object,
325
+ context?: object
326
+ ): void;
327
+
328
+ off<EventName extends keyof EventMap>(
329
+ eventName?: EventName,
330
+ callback?: (event: EventMap[EventName]) => void,
331
+ context?: object
332
+ ): void;
333
+
334
+ off(
335
+ eventName: `signal:${string}`,
336
+ context?: object
337
+ ): void;
338
+
339
+ off(
340
+ eventName?: string,
341
+ callback?: (event: Event<string, any>) => void,
342
+ context?: object
343
+ ): void;
344
+
345
+ off(
346
+ eventMap: object,
347
+ context?: object
348
+ ): void;
349
+ }
271
350
 
272
351
  export class Publisher extends OTEventEmitter<{
273
352
  accessAllowed: Event<'accessAllowed', Publisher>;
@@ -384,7 +463,7 @@ declare namespace OT {
384
463
  context?: object
385
464
  ): void;
386
465
 
387
- export class Session extends OTEventEmitter<{
466
+ export class Session extends SessionOTEventEmitter<{
388
467
  archiveStarted: Event<'archiveStarted', Session> & {
389
468
  id: string;
390
469
  name: string;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.28.4 da3a0b8
2
+ * @license OpenTok.js 2.28.4 38b7282
3
3
  *
4
4
  * Copyright (c) 2010-2024 TokBox, Inc.
5
5
  * Subject to the applicable Software Development Kit (SDK) License Agreement:
6
6
  * https://www.vonage.com/legal/communications-apis/terms-of-use/
7
7
  *
8
- * Date: Mon, 28 Oct 2024 18:32:41 GMT
8
+ * Date: Mon, 28 Oct 2024 22:39:07 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8070,7 +8070,7 @@ const logging = (0, _log.default)('StaticConfig');
8070
8070
  */
8071
8071
 
8072
8072
  /** @type builtInConfig */
8073
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.28.4","buildHash":"da3a0b8","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
8073
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.28.4","buildHash":"38b7282","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
8074
8074
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
8075
8075
  const liveConfigMap = {
8076
8076
  apiUrl: 'apiURL',
@@ -20318,7 +20318,7 @@ function PublisherFactory(_ref) {
20318
20318
  return _ref48.apply(this, arguments);
20319
20319
  };
20320
20320
  }();
20321
- prevAudioSource = _this.getAudioSource();
20321
+ prevAudioSource = _this._getAudioSource();
20322
20322
  if (prevAudioSource) {
20323
20323
  _context36.next = 7;
20324
20324
  break;
@@ -20452,6 +20452,14 @@ function PublisherFactory(_ref) {
20452
20452
  }();
20453
20453
  this.setAudioSource = setAudioSource;
20454
20454
 
20455
+ // Internal method to get actual current track which may be MediaStreamTrackGenerator if track is filtered
20456
+ this._getAudioSource = () => {
20457
+ if (webRTCStream && webRTCStream.getAudioTracks().length > 0) {
20458
+ return webRTCStream.getAudioTracks()[0];
20459
+ }
20460
+ return null;
20461
+ };
20462
+
20455
20463
  /**
20456
20464
  * Returns the MediaStreamTrack object used as the audio input source for the publisher.
20457
20465
  * If the publisher does not have an audio source, this method returns null.
@@ -20463,10 +20471,11 @@ function PublisherFactory(_ref) {
20463
20471
  * @return {MediaStreamTrack} The audio source for the publisher (or null, if there is none).
20464
20472
  */
20465
20473
  this.getAudioSource = () => {
20466
- if (webRTCStream && webRTCStream.getAudioTracks().length > 0) {
20467
- return webRTCStream.getAudioTracks()[0];
20474
+ if (_audioMediaProcessorConnector) {
20475
+ // If the track is being filtered we return the original track so user can get device id
20476
+ return _audioMediaProcessorConnector.originalTrack;
20468
20477
  }
20469
- return null;
20478
+ return this._getAudioSource();
20470
20479
  };
20471
20480
 
20472
20481
  /**
@@ -22272,7 +22281,7 @@ function PublisherFactory(_ref) {
22272
22281
  case 24:
22273
22282
  filteredAudioTrack = _context48.sent;
22274
22283
  _context48.next = 27;
22275
- return replaceAudioTrack(_this.getAudioSource(), filteredAudioTrack);
22284
+ return replaceAudioTrack(_this._getAudioSource(), filteredAudioTrack);
22276
22285
  case 27:
22277
22286
  _context48.next = 34;
22278
22287
  break;