agora-rte-sdk 3.7.5 → 3.7.6

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.
@@ -1,4 +1,4 @@
1
- import { AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcLatencyLevelType, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoStreamType } from './type';
1
+ import { AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcLatencyLevelType, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoStreamType, AgoraRtcChannelPublisherObserver } from './type';
2
2
  import { AgoraRtcSourceManager } from './source-manager';
3
3
  import { AgoraRtcStreamPublishPool } from './publish-pool';
4
4
  import { AgoraRtcScreenScenarioType } from './type';
@@ -66,4 +66,6 @@ export declare abstract class AgoraRtcChannelPublisher {
66
66
  * release all resources.
67
67
  */
68
68
  abstract release(): void;
69
+ abstract addObserver(observer: AgoraRtcChannelPublisherObserver): void;
70
+ abstract removeObserver(observer: AgoraRtcChannelPublisherObserver): void;
69
71
  }
@@ -467,3 +467,6 @@ export interface AgoraRtcDiffList {
467
467
  videoSourceState: AgoraRtcMediaSourceState;
468
468
  videoSourceType: AgoraRtcVideoSourceType;
469
469
  }
470
+ export interface AgoraRtcChannelPublisherObserver {
471
+ onLocalVideoStatsUpdated?(stats: AgoraRtcLocalVideoStats): void;
472
+ }
@@ -236,7 +236,7 @@ var AgoraRteLocalUser = exports.AgoraRteLocalUser = /*#__PURE__*/function () {
236
236
  while (1) switch (_context3.prev = _context3.next) {
237
237
  case 0:
238
238
  _context3.next = 1;
239
- return this._apiService.upsertStreamBatch({
239
+ return this._apiService.createStreamBatch({
240
240
  roomUuid: this._fromSceneId,
241
241
  streams: configs.map(function (config) {
242
242
  var _config$generateToken;
@@ -355,7 +355,7 @@ var AgoraRteLocalUser = exports.AgoraRteLocalUser = /*#__PURE__*/function () {
355
355
  }
356
356
  if (args.length === 1) {
357
357
  var _privileges = args[0];
358
- return this._apiService.upsertStreamBatch({
358
+ return this._apiService.updateStreamBatch({
359
359
  roomUuid: this._fromSceneId,
360
360
  streams: Object.keys(_privileges).map(function (streamId) {
361
361
  return {
@@ -126,7 +126,22 @@ export declare class AgoraRteServiceApi {
126
126
  };
127
127
  };
128
128
  }): Promise<any>;
129
- upsertStreamBatch({ roomUuid, streams, cause, }: {
129
+ createStreamBatch({ roomUuid, streams, cause, }: {
130
+ roomUuid: string;
131
+ streams: {
132
+ streamName?: string;
133
+ userUuid?: string;
134
+ streamUuid?: string;
135
+ videoState?: AgoraRteMediaPublishState;
136
+ audioState?: AgoraRteMediaPublishState;
137
+ videoSourceType?: AgoraRteVideoSourceType;
138
+ audioSourceType?: AgoraRteAudioSourceType;
139
+ videoSourceUuid?: string;
140
+ audioSourceUuid?: string;
141
+ }[];
142
+ cause?: AgoraRteOperatCause;
143
+ }): Promise<any>;
144
+ updateStreamBatch({ roomUuid, streams, cause, }: {
130
145
  roomUuid: string;
131
146
  streams: {
132
147
  streamName?: string;
@@ -420,9 +420,9 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
420
420
  return upsertStream;
421
421
  }()
422
422
  }, {
423
- key: "upsertStreamBatch",
423
+ key: "createStreamBatch",
424
424
  value: function () {
425
- var _upsertStreamBatch = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(_ref0) {
425
+ var _createStreamBatch = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(_ref0) {
426
426
  var roomUuid, streams, cause;
427
427
  return _regenerator["default"].wrap(function (_context10) {
428
428
  while (1) switch (_context10.prev = _context10.next) {
@@ -431,7 +431,7 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
431
431
  _context10.next = 1;
432
432
  return this._client.fetch({
433
433
  path: "/v1/rooms/".concat(roomUuid, "/streams"),
434
- method: 'PUT',
434
+ method: 'POST',
435
435
  data: {
436
436
  streams: streams,
437
437
  cause: cause
@@ -445,21 +445,52 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
445
445
  }
446
446
  }, _callee10, this);
447
447
  }));
448
- function upsertStreamBatch(_x10) {
449
- return _upsertStreamBatch.apply(this, arguments);
448
+ function createStreamBatch(_x10) {
449
+ return _createStreamBatch.apply(this, arguments);
450
450
  }
451
- return upsertStreamBatch;
451
+ return createStreamBatch;
452
452
  }()
453
453
  }, {
454
- key: "updateStreamBatchByCondition",
454
+ key: "updateStreamBatch",
455
455
  value: function () {
456
- var _updateStreamBatchByCondition = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(_ref1) {
457
- var roomUuid, videoState, audioState, includeRoles, excludeRoles, condition, cause;
456
+ var _updateStreamBatch = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(_ref1) {
457
+ var roomUuid, streams, cause;
458
458
  return _regenerator["default"].wrap(function (_context11) {
459
459
  while (1) switch (_context11.prev = _context11.next) {
460
460
  case 0:
461
- roomUuid = _ref1.roomUuid, videoState = _ref1.videoState, audioState = _ref1.audioState, includeRoles = _ref1.includeRoles, excludeRoles = _ref1.excludeRoles, condition = _ref1.condition, cause = _ref1.cause;
461
+ roomUuid = _ref1.roomUuid, streams = _ref1.streams, cause = _ref1.cause;
462
462
  _context11.next = 1;
463
+ return this._client.fetch({
464
+ path: "/v1/rooms/".concat(roomUuid, "/streams"),
465
+ method: 'PUT',
466
+ data: {
467
+ streams: streams,
468
+ cause: cause
469
+ }
470
+ });
471
+ case 1:
472
+ return _context11.abrupt("return", _context11.sent);
473
+ case 2:
474
+ case "end":
475
+ return _context11.stop();
476
+ }
477
+ }, _callee11, this);
478
+ }));
479
+ function updateStreamBatch(_x11) {
480
+ return _updateStreamBatch.apply(this, arguments);
481
+ }
482
+ return updateStreamBatch;
483
+ }()
484
+ }, {
485
+ key: "updateStreamBatchByCondition",
486
+ value: function () {
487
+ var _updateStreamBatchByCondition = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(_ref10) {
488
+ var roomUuid, videoState, audioState, includeRoles, excludeRoles, condition, cause;
489
+ return _regenerator["default"].wrap(function (_context12) {
490
+ while (1) switch (_context12.prev = _context12.next) {
491
+ case 0:
492
+ roomUuid = _ref10.roomUuid, videoState = _ref10.videoState, audioState = _ref10.audioState, includeRoles = _ref10.includeRoles, excludeRoles = _ref10.excludeRoles, condition = _ref10.condition, cause = _ref10.cause;
493
+ _context12.next = 1;
463
494
  return this._client.fetch({
464
495
  path: "/v1/rooms/".concat(roomUuid, "/conditions/streams"),
465
496
  method: 'PUT',
@@ -475,14 +506,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
475
506
  }
476
507
  });
477
508
  case 1:
478
- return _context11.abrupt("return", _context11.sent);
509
+ return _context12.abrupt("return", _context12.sent);
479
510
  case 2:
480
511
  case "end":
481
- return _context11.stop();
512
+ return _context12.stop();
482
513
  }
483
- }, _callee11, this);
514
+ }, _callee12, this);
484
515
  }));
485
- function updateStreamBatchByCondition(_x11) {
516
+ function updateStreamBatchByCondition(_x12) {
486
517
  return _updateStreamBatchByCondition.apply(this, arguments);
487
518
  }
488
519
  return updateStreamBatchByCondition;
@@ -490,24 +521,24 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
490
521
  }, {
491
522
  key: "deleteStream",
492
523
  value: function () {
493
- var _deleteStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(roomUuid, userUuid, streamUuid) {
494
- return _regenerator["default"].wrap(function (_context12) {
495
- while (1) switch (_context12.prev = _context12.next) {
524
+ var _deleteStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13(roomUuid, userUuid, streamUuid) {
525
+ return _regenerator["default"].wrap(function (_context13) {
526
+ while (1) switch (_context13.prev = _context13.next) {
496
527
  case 0:
497
- _context12.next = 1;
528
+ _context13.next = 1;
498
529
  return this._client.fetch({
499
530
  path: "/v1/rooms/".concat(roomUuid, "/users/").concat(userUuid, "/streams/").concat(streamUuid),
500
531
  method: 'DELETE'
501
532
  });
502
533
  case 1:
503
- return _context12.abrupt("return", _context12.sent);
534
+ return _context13.abrupt("return", _context13.sent);
504
535
  case 2:
505
536
  case "end":
506
- return _context12.stop();
537
+ return _context13.stop();
507
538
  }
508
- }, _callee12, this);
539
+ }, _callee13, this);
509
540
  }));
510
- function deleteStream(_x12, _x13, _x14) {
541
+ function deleteStream(_x13, _x14, _x15) {
511
542
  return _deleteStream.apply(this, arguments);
512
543
  }
513
544
  return deleteStream;
@@ -515,11 +546,11 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
515
546
  }, {
516
547
  key: "deleteStreamBatch",
517
548
  value: function () {
518
- var _deleteStreamBatch = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13(roomUuid, streams, cause) {
519
- return _regenerator["default"].wrap(function (_context13) {
520
- while (1) switch (_context13.prev = _context13.next) {
549
+ var _deleteStreamBatch = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14(roomUuid, streams, cause) {
550
+ return _regenerator["default"].wrap(function (_context14) {
551
+ while (1) switch (_context14.prev = _context14.next) {
521
552
  case 0:
522
- _context13.next = 1;
553
+ _context14.next = 1;
523
554
  return this._client.fetch({
524
555
  path: "/v1/rooms/".concat(roomUuid, "/streams"),
525
556
  method: 'DELETE',
@@ -529,14 +560,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
529
560
  }
530
561
  });
531
562
  case 1:
532
- return _context13.abrupt("return", _context13.sent);
563
+ return _context14.abrupt("return", _context14.sent);
533
564
  case 2:
534
565
  case "end":
535
- return _context13.stop();
566
+ return _context14.stop();
536
567
  }
537
- }, _callee13, this);
568
+ }, _callee14, this);
538
569
  }));
539
- function deleteStreamBatch(_x15, _x16, _x17) {
570
+ function deleteStreamBatch(_x16, _x17, _x18) {
540
571
  return _deleteStreamBatch.apply(this, arguments);
541
572
  }
542
573
  return deleteStreamBatch;
@@ -544,13 +575,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
544
575
  }, {
545
576
  key: "updateStream",
546
577
  value: function () {
547
- var _updateStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14(_ref10) {
578
+ var _updateStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15(_ref11) {
548
579
  var roomUuid, userUuid, streamUuid, videoSourceState, audioSourceState, videoSourceUuid, audioSourceUuid;
549
- return _regenerator["default"].wrap(function (_context14) {
550
- while (1) switch (_context14.prev = _context14.next) {
580
+ return _regenerator["default"].wrap(function (_context15) {
581
+ while (1) switch (_context15.prev = _context15.next) {
551
582
  case 0:
552
- roomUuid = _ref10.roomUuid, userUuid = _ref10.userUuid, streamUuid = _ref10.streamUuid, videoSourceState = _ref10.videoSourceState, audioSourceState = _ref10.audioSourceState, videoSourceUuid = _ref10.videoSourceUuid, audioSourceUuid = _ref10.audioSourceUuid;
553
- _context14.next = 1;
583
+ roomUuid = _ref11.roomUuid, userUuid = _ref11.userUuid, streamUuid = _ref11.streamUuid, videoSourceState = _ref11.videoSourceState, audioSourceState = _ref11.audioSourceState, videoSourceUuid = _ref11.videoSourceUuid, audioSourceUuid = _ref11.audioSourceUuid;
584
+ _context15.next = 1;
554
585
  return this._client.fetch({
555
586
  path: "/v1/rooms/".concat(roomUuid, "/users/").concat(userUuid, "/streams/").concat(streamUuid),
556
587
  method: 'PATCH',
@@ -562,14 +593,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
562
593
  }
563
594
  });
564
595
  case 1:
565
- return _context14.abrupt("return", _context14.sent);
596
+ return _context15.abrupt("return", _context15.sent);
566
597
  case 2:
567
598
  case "end":
568
- return _context14.stop();
599
+ return _context15.stop();
569
600
  }
570
- }, _callee14, this);
601
+ }, _callee15, this);
571
602
  }));
572
- function updateStream(_x18) {
603
+ function updateStream(_x19) {
573
604
  return _updateStream.apply(this, arguments);
574
605
  }
575
606
  return updateStream;
@@ -577,13 +608,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
577
608
  }, {
578
609
  key: "sendRoomChatMessage",
579
610
  value: function () {
580
- var _sendRoomChatMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15(_ref11) {
611
+ var _sendRoomChatMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16(_ref12) {
581
612
  var roomUuid, message, res;
582
- return _regenerator["default"].wrap(function (_context15) {
583
- while (1) switch (_context15.prev = _context15.next) {
613
+ return _regenerator["default"].wrap(function (_context16) {
614
+ while (1) switch (_context16.prev = _context16.next) {
584
615
  case 0:
585
- roomUuid = _ref11.roomUuid, message = _ref11.message;
586
- _context15.next = 1;
616
+ roomUuid = _ref12.roomUuid, message = _ref12.message;
617
+ _context16.next = 1;
587
618
  return this._client.fetch({
588
619
  path: "/v1/rooms/".concat(roomUuid, "/chat/channel"),
589
620
  method: 'POST',
@@ -593,15 +624,15 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
593
624
  }
594
625
  });
595
626
  case 1:
596
- res = _context15.sent;
597
- return _context15.abrupt("return", res.data);
627
+ res = _context16.sent;
628
+ return _context16.abrupt("return", res.data);
598
629
  case 2:
599
630
  case "end":
600
- return _context15.stop();
631
+ return _context16.stop();
601
632
  }
602
- }, _callee15, this);
633
+ }, _callee16, this);
603
634
  }));
604
- function sendRoomChatMessage(_x19) {
635
+ function sendRoomChatMessage(_x20) {
605
636
  return _sendRoomChatMessage.apply(this, arguments);
606
637
  }
607
638
  return sendRoomChatMessage;
@@ -609,13 +640,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
609
640
  }, {
610
641
  key: "sendCustomChannelMessage",
611
642
  value: function () {
612
- var _sendCustomChannelMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16(_ref12) {
613
- var roomUuid, payload, cmd, _ref12$sync, sync;
614
- return _regenerator["default"].wrap(function (_context16) {
615
- while (1) switch (_context16.prev = _context16.next) {
643
+ var _sendCustomChannelMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17(_ref13) {
644
+ var roomUuid, payload, cmd, _ref13$sync, sync;
645
+ return _regenerator["default"].wrap(function (_context17) {
646
+ while (1) switch (_context17.prev = _context17.next) {
616
647
  case 0:
617
- roomUuid = _ref12.roomUuid, payload = _ref12.payload, cmd = _ref12.cmd, _ref12$sync = _ref12.sync, sync = _ref12$sync === void 0 ? false : _ref12$sync;
618
- _context16.next = 1;
648
+ roomUuid = _ref13.roomUuid, payload = _ref13.payload, cmd = _ref13.cmd, _ref13$sync = _ref13.sync, sync = _ref13$sync === void 0 ? false : _ref13$sync;
649
+ _context17.next = 1;
619
650
  return this._client.fetch({
620
651
  path: "/v1/rooms/".concat(roomUuid, "/message/channel"),
621
652
  method: 'POST',
@@ -628,14 +659,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
628
659
  }
629
660
  });
630
661
  case 1:
631
- return _context16.abrupt("return", _context16.sent);
662
+ return _context17.abrupt("return", _context17.sent);
632
663
  case 2:
633
664
  case "end":
634
- return _context16.stop();
665
+ return _context17.stop();
635
666
  }
636
- }, _callee16, this);
667
+ }, _callee17, this);
637
668
  }));
638
- function sendCustomChannelMessage(_x20) {
669
+ function sendCustomChannelMessage(_x21) {
639
670
  return _sendCustomChannelMessage.apply(this, arguments);
640
671
  }
641
672
  return sendCustomChannelMessage;
@@ -643,13 +674,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
643
674
  }, {
644
675
  key: "sendCustomPeerMessage",
645
676
  value: function () {
646
- var _sendCustomPeerMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17(_ref13) {
647
- var payload, toUserUuid, _ref13$waitForAck, waitForAck;
648
- return _regenerator["default"].wrap(function (_context17) {
649
- while (1) switch (_context17.prev = _context17.next) {
677
+ var _sendCustomPeerMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18(_ref14) {
678
+ var payload, toUserUuid, _ref14$waitForAck, waitForAck;
679
+ return _regenerator["default"].wrap(function (_context18) {
680
+ while (1) switch (_context18.prev = _context18.next) {
650
681
  case 0:
651
- payload = _ref13.payload, toUserUuid = _ref13.toUserUuid, _ref13$waitForAck = _ref13.waitForAck, waitForAck = _ref13$waitForAck === void 0 ? false : _ref13$waitForAck;
652
- _context17.next = 1;
682
+ payload = _ref14.payload, toUserUuid = _ref14.toUserUuid, _ref14$waitForAck = _ref14.waitForAck, waitForAck = _ref14$waitForAck === void 0 ? false : _ref14$waitForAck;
683
+ _context18.next = 1;
653
684
  return this._client.fetch({
654
685
  path: "/v2/users/".concat(toUserUuid, "/messages/peer"),
655
686
  method: 'POST',
@@ -659,14 +690,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
659
690
  }
660
691
  });
661
692
  case 1:
662
- return _context17.abrupt("return", _context17.sent);
693
+ return _context18.abrupt("return", _context18.sent);
663
694
  case 2:
664
695
  case "end":
665
- return _context17.stop();
696
+ return _context18.stop();
666
697
  }
667
- }, _callee17, this);
698
+ }, _callee18, this);
668
699
  }));
669
- function sendCustomPeerMessage(_x21) {
700
+ function sendCustomPeerMessage(_x22) {
670
701
  return _sendCustomPeerMessage.apply(this, arguments);
671
702
  }
672
703
  return sendCustomPeerMessage;
@@ -674,26 +705,26 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
674
705
  }, {
675
706
  key: "updateOnlineState",
676
707
  value: function () {
677
- var _updateOnlineState = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18(_ref14) {
708
+ var _updateOnlineState = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19(_ref15) {
678
709
  var userUuid, roomUuid;
679
- return _regenerator["default"].wrap(function (_context18) {
680
- while (1) switch (_context18.prev = _context18.next) {
710
+ return _regenerator["default"].wrap(function (_context19) {
711
+ while (1) switch (_context19.prev = _context19.next) {
681
712
  case 0:
682
- userUuid = _ref14.userUuid, roomUuid = _ref14.roomUuid;
683
- _context18.next = 1;
713
+ userUuid = _ref15.userUuid, roomUuid = _ref15.roomUuid;
714
+ _context19.next = 1;
684
715
  return this._client.fetch({
685
716
  path: "/v1/rooms/".concat(roomUuid, "/users/").concat(userUuid, "/states/1"),
686
717
  method: 'PUT'
687
718
  });
688
719
  case 1:
689
- return _context18.abrupt("return", _context18.sent);
720
+ return _context19.abrupt("return", _context19.sent);
690
721
  case 2:
691
722
  case "end":
692
- return _context18.stop();
723
+ return _context19.stop();
693
724
  }
694
- }, _callee18, this);
725
+ }, _callee19, this);
695
726
  }));
696
- function updateOnlineState(_x22) {
727
+ function updateOnlineState(_x23) {
697
728
  return _updateOnlineState.apply(this, arguments);
698
729
  }
699
730
  return updateOnlineState;
@@ -701,13 +732,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
701
732
  }, {
702
733
  key: "fetchUserList",
703
734
  value: function () {
704
- var _fetchUserList = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19(_ref15) {
735
+ var _fetchUserList = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee20(_ref16) {
705
736
  var userRole, pageIndex, pageSize, roomId, userIds, excludeResponse;
706
- return _regenerator["default"].wrap(function (_context19) {
707
- while (1) switch (_context19.prev = _context19.next) {
737
+ return _regenerator["default"].wrap(function (_context20) {
738
+ while (1) switch (_context20.prev = _context20.next) {
708
739
  case 0:
709
- userRole = _ref15.userRole, pageIndex = _ref15.pageIndex, pageSize = _ref15.pageSize, roomId = _ref15.roomId, userIds = _ref15.userIds, excludeResponse = _ref15.excludeResponse;
710
- _context19.next = 1;
740
+ userRole = _ref16.userRole, pageIndex = _ref16.pageIndex, pageSize = _ref16.pageSize, roomId = _ref16.roomId, userIds = _ref16.userIds, excludeResponse = _ref16.excludeResponse;
741
+ _context20.next = 1;
711
742
  return this._client.fetch({
712
743
  path: "/v2/rooms/".concat(roomId, "/users/page"),
713
744
  method: 'GET',
@@ -720,14 +751,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
720
751
  }
721
752
  });
722
753
  case 1:
723
- return _context19.abrupt("return", _context19.sent);
754
+ return _context20.abrupt("return", _context20.sent);
724
755
  case 2:
725
756
  case "end":
726
- return _context19.stop();
757
+ return _context20.stop();
727
758
  }
728
- }, _callee19, this);
759
+ }, _callee20, this);
729
760
  }));
730
- function fetchUserList(_x23) {
761
+ function fetchUserList(_x24) {
731
762
  return _fetchUserList.apply(this, arguments);
732
763
  }
733
764
  return fetchUserList;
@@ -735,13 +766,13 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
735
766
  }, {
736
767
  key: "uploadEvent",
737
768
  value: function () {
738
- var _uploadEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee20(_ref16) {
769
+ var _uploadEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee21(_ref17) {
739
770
  var userId, event;
740
- return _regenerator["default"].wrap(function (_context20) {
741
- while (1) switch (_context20.prev = _context20.next) {
771
+ return _regenerator["default"].wrap(function (_context21) {
772
+ while (1) switch (_context21.prev = _context21.next) {
742
773
  case 0:
743
- userId = _ref16.userId, event = _ref16.event;
744
- _context20.next = 1;
774
+ userId = _ref17.userId, event = _ref17.event;
775
+ _context21.next = 1;
745
776
  return this._client.fetch({
746
777
  path: "/v1/users/".concat(userId, "/client/events"),
747
778
  method: 'POST',
@@ -752,14 +783,14 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
752
783
  }
753
784
  });
754
785
  case 1:
755
- return _context20.abrupt("return", _context20.sent);
786
+ return _context21.abrupt("return", _context21.sent);
756
787
  case 2:
757
788
  case "end":
758
- return _context20.stop();
789
+ return _context21.stop();
759
790
  }
760
- }, _callee20, this);
791
+ }, _callee21, this);
761
792
  }));
762
- function uploadEvent(_x24) {
793
+ function uploadEvent(_x25) {
763
794
  return _uploadEvent.apply(this, arguments);
764
795
  }
765
796
  return uploadEvent;
@@ -29,6 +29,7 @@ export declare class AgoraRtcChannelClientImpl extends AgoraRtcChannelClient {
29
29
  private _rtcStatsTask;
30
30
  private _rtcConnection;
31
31
  private _rtcClientChannelObserver;
32
+ private _rtcClientChannelPublisherObserver;
32
33
  constructor(_channelId: string, _localUserId: string, _latencyLevel: AgoraRtcLatencyLevelType, _rtcEngine: IRtcEngineEx, _sourceManager: AgoraRtcSourceManager, _rtcConfigs: AgoraElectronRtcClientInitConfig, _rtcClientObservable: AgoraObservable<AgoraRtcClientObserver>, _canvasHelper: AgoraRtcCanvasHelper, _canvasTagPool: AgoraRtcCanvasTagPool);
33
34
  release(): void;
34
35
  get rtcConnection(): AgoraRtcConnection;
@@ -73,6 +74,7 @@ export declare class AgoraRtcChannelClientImpl extends AgoraRtcChannelClient {
73
74
  private _handleUserLeave;
74
75
  private _handleRemoteVideoStats;
75
76
  private _handleRemoteAudioStats;
77
+ private _onLocalVideoStatsUpdated;
76
78
  private _handleLocalVideoStats;
77
79
  private _handleLocalAudioStats;
78
80
  private _handleFirstRemoteVideoFrame;
@@ -111,6 +111,11 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
111
111
  rxVideoKBytes: 0
112
112
  });
113
113
  (0, _defineProperty2["default"])(_this, "_rtcStatsTask", null);
114
+ (0, _defineProperty2["default"])(_this, "_rtcClientChannelPublisherObserver", {
115
+ onLocalVideoStatsUpdated: function onLocalVideoStatsUpdated(stats) {
116
+ _this._onLocalVideoStatsUpdated(stats);
117
+ }
118
+ });
114
119
  _this._channelId = _channelId;
115
120
  _this._latencyLevel = _latencyLevel;
116
121
  _this._rtcEngine = _rtcEngine;
@@ -125,6 +130,7 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
125
130
  _this.canvasTagPool = _canvasTagPool;
126
131
  _this._rtcEngine.enableAudioVolumeIndicationEx(_utils.VOLUME_INDICATION_INTERVAL, _utils.VOLUME_INDICATION_SMOOTH, false, _this._rtcConnection);
127
132
  _this._publisher = new _publisher.AgoraRtcChannelPublisherImpl(_this._rtcEngine, _this._rtcConnection, _this._latencyLevel, _this._sourceManager, _this._rtcConfigs);
133
+ _this._publisher.addObserver(_this._rtcClientChannelPublisherObserver);
128
134
  _this._subscriber = new _subscriber.AgoraRtcChannelSubscriberImpl(_this._rtcEngine, _this._rtcConnection);
129
135
 
130
136
  // TODO: need optimize
@@ -315,6 +321,7 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
315
321
  }, {
316
322
  key: "leave",
317
323
  value: function leave() {
324
+ this._publisher.removeObserver(this._rtcClientChannelPublisherObserver);
318
325
  this._handleBeforeLeave();
319
326
  this._rtcEngine.leaveChannelEx(this._rtcConnection);
320
327
  return Promise.resolve();
@@ -627,14 +634,8 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
627
634
  this.observable.notifyObservers('onRemoteAudioStatsUpdated', this._channelId, streamId, remoteStats);
628
635
  }
629
636
  }, {
630
- key: "_handleLocalVideoStats",
631
- value: function _handleLocalVideoStats(connection, stats) {
632
- if (!this._needExcuteThisCallback(connection)) {
633
- return;
634
- }
635
-
636
- // 这里SDK有个已知问题,详见:https://jira.agoralab.co/browse/NMS-21532,但是
637
- // 不影响视频信息统计,只影响代码类型检查
637
+ key: "_onLocalVideoStatsUpdated",
638
+ value: function _onLocalVideoStatsUpdated(stats) {
638
639
  if (!stats.uid) return;
639
640
  var streamId = "".concat(stats.uid);
640
641
  var localStats = {
@@ -650,6 +651,17 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
650
651
  };
651
652
  this.observable.notifyObservers('onLocalVideoStatsUpdated', this._channelId, streamId, localStats);
652
653
  }
654
+ }, {
655
+ key: "_handleLocalVideoStats",
656
+ value: function _handleLocalVideoStats(connection, stats) {
657
+ if (!this._needExcuteThisCallback(connection)) {
658
+ return;
659
+ }
660
+
661
+ // 这里SDK有个已知问题,详见:https://jira.agoralab.co/browse/NMS-21532,但是
662
+ // 不影响视频信息统计,只影响代码类型检查
663
+ this._onLocalVideoStatsUpdated(stats);
664
+ }
653
665
  }, {
654
666
  key: "_handleLocalAudioStats",
655
667
  value: function _handleLocalAudioStats(connection, stats) {
@@ -696,7 +708,7 @@ var AgoraRtcChannelClientImpl = exports.AgoraRtcChannelClientImpl = /*#__PURE__*
696
708
  }]);
697
709
  }(_rtc.AgoraRtcChannelClient);
698
710
  _AgoraRtcChannelClientImpl = AgoraRtcChannelClientImpl;
699
- var _applyDecs$e = _applyDecs(_AgoraRtcChannelClientImpl, [[_decorator.trace, 2, "release"], [_decorator.trace, 2, "addAudioRawDataObserver"], [_decorator.trace, 2, "removeAudioRawDataObserver"], [_decorator.trace, 2, "join"], [_decorator.trace, 2, "rejoin"], [[_decorator.trace, _decorator.bound], 2, "pause"], [[_decorator.trace, _decorator.bound], 2, "resume"], [_decorator.bound, 2, "_resume"], [_decorator.trace, 2, "leave"], [_decorator.trace, 2, "setEncryptionConfig"], [_decorator.trace, 2, "startRenderRemoteVideoStream"], [_decorator.trace, 2, "stopRenderRemoteVideoStream"], [_decorator.trace, 2, "stopRenderRemoteVideoStreamOnAllCanvas"], [_decorator.trace, 2, "takeSnapshot"], [_decorator.trace, 2, "adjustRemoteAudioStreamVolume"], [_decorator.trace, 2, "getNetworkStats"], [_decorator.trace, 2, "renewToken"], [_decorator.trace, 2, "setVideoEncoderConfig"], [_decorator.trace, 2, "updateRemoteAudioStreamVolume"], [_decorator.trace, 2, "setScreenScenario"], [_decorator.bound, 2, "_handleJoinChannelSuccess"], [_decorator.bound, 2, "_handleBeforeLeave"], [_decorator.bound, 2, "_handleRemoteAudioVolumeUpdated"], [_decorator.bound, 2, "_handleNetworkQuality"], [_decorator.bound, 2, "_handleRtcStats"], [_decorator.bound, 2, "_handleRejoinChannel"], [_decorator.bound, 2, "_handleConnectionLost"], [_decorator.bound, 2, "_handleUserJoin"], [_decorator.bound, 2, "_handleUserLeave"], [_decorator.bound, 2, "_handleRemoteVideoStats"], [_decorator.bound, 2, "_handleRemoteAudioStats"], [_decorator.bound, 2, "_handleLocalVideoStats"], [_decorator.bound, 2, "_handleLocalAudioStats"], [_decorator.bound, 2, "_handleFirstRemoteVideoFrame"], [_decorator.bound, 2, "_handleConnectionStateChanged"]], [], 0, void 0, _rtc.AgoraRtcChannelClient).e;
711
+ var _applyDecs$e = _applyDecs(_AgoraRtcChannelClientImpl, [[_decorator.trace, 2, "release"], [_decorator.trace, 2, "addAudioRawDataObserver"], [_decorator.trace, 2, "removeAudioRawDataObserver"], [_decorator.trace, 2, "join"], [_decorator.trace, 2, "rejoin"], [[_decorator.trace, _decorator.bound], 2, "pause"], [[_decorator.trace, _decorator.bound], 2, "resume"], [_decorator.bound, 2, "_resume"], [_decorator.trace, 2, "leave"], [_decorator.trace, 2, "setEncryptionConfig"], [_decorator.trace, 2, "startRenderRemoteVideoStream"], [_decorator.trace, 2, "stopRenderRemoteVideoStream"], [_decorator.trace, 2, "stopRenderRemoteVideoStreamOnAllCanvas"], [_decorator.trace, 2, "takeSnapshot"], [_decorator.trace, 2, "adjustRemoteAudioStreamVolume"], [_decorator.trace, 2, "getNetworkStats"], [_decorator.trace, 2, "renewToken"], [_decorator.trace, 2, "setVideoEncoderConfig"], [_decorator.trace, 2, "updateRemoteAudioStreamVolume"], [_decorator.trace, 2, "setScreenScenario"], [_decorator.bound, 2, "_handleJoinChannelSuccess"], [_decorator.bound, 2, "_handleBeforeLeave"], [_decorator.bound, 2, "_handleRemoteAudioVolumeUpdated"], [_decorator.bound, 2, "_handleNetworkQuality"], [_decorator.bound, 2, "_handleRtcStats"], [_decorator.bound, 2, "_handleRejoinChannel"], [_decorator.bound, 2, "_handleConnectionLost"], [_decorator.bound, 2, "_handleUserJoin"], [_decorator.bound, 2, "_handleUserLeave"], [_decorator.bound, 2, "_handleRemoteVideoStats"], [_decorator.bound, 2, "_handleRemoteAudioStats"], [_decorator.bound, 2, "_onLocalVideoStatsUpdated"], [_decorator.bound, 2, "_handleLocalVideoStats"], [_decorator.bound, 2, "_handleLocalAudioStats"], [_decorator.bound, 2, "_handleFirstRemoteVideoFrame"], [_decorator.bound, 2, "_handleConnectionStateChanged"]], [], 0, void 0, _rtc.AgoraRtcChannelClient).e;
700
712
  var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
701
713
  _initProto = _applyDecs$e2[0];
702
714
  _applyDecs$e;
@@ -17,6 +17,7 @@ export declare class AgoraElectronRtcStreamPublishPoolImpl extends AgoraRtcStrea
17
17
  unpublishVideo(streamId: string, type: AgoraRteVideoSourceType): number;
18
18
  unpublishAudio(streamId: string, type: AgoraRteAudioSourceType): number;
19
19
  getItem(streamId: string): AgoraRtcElectronStreamPublishPoolItem | undefined;
20
+ release(): void;
20
21
  private _convertChannelMediaOptions;
21
22
  private _convertSourceIndexToMediaOptions;
22
23
  private _checkIfNeedNotifyUpdate;
@@ -318,6 +318,25 @@ var AgoraElectronRtcStreamPublishPoolImpl = exports.AgoraElectronRtcStreamPublis
318
318
  value: function getItem(streamId) {
319
319
  return this._itemMap.get(streamId);
320
320
  }
321
+ }, {
322
+ key: "release",
323
+ value: function release() {
324
+ var _iterator3 = _createForOfIteratorHelper(this._itemMap),
325
+ _step3;
326
+ try {
327
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
328
+ var _step3$value = (0, _slicedToArray2["default"])(_step3.value, 2),
329
+ item = _step3$value[1];
330
+ if (!item.isMainConnection && item.connectionIsJoin) {
331
+ this.observable.notifyObservers('onConnectionLeaveChannel', item);
332
+ }
333
+ }
334
+ } catch (err) {
335
+ _iterator3.e(err);
336
+ } finally {
337
+ _iterator3.f();
338
+ }
339
+ }
321
340
  }, {
322
341
  key: "_convertChannelMediaOptions",
323
342
  value: function _convertChannelMediaOptions(item) {
@@ -1,17 +1,20 @@
1
1
  import type { IRtcEngineEx } from 'agora-electron-sdk';
2
2
  import { AgoraRtcChannelPublisher } from '../../../core/rtc/publisher';
3
- import { AgoraRtcAudioSourceType, AgoraRtcConnection, AgoraRtcLatencyLevelType, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoSourceType, AgoraRtcVideoStreamType } from '../../../core/rtc/type';
3
+ import { AgoraRtcAudioSourceType, AgoraRtcConnection, AgoraRtcLatencyLevelType, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoSourceType, AgoraRtcVideoStreamType, AgoraRtcChannelPublisherObserver } from '../../../core/rtc/type';
4
4
  import { AgoraElectronRtcChannelPublisherInitConfig } from './type';
5
5
  import { AgoraRtcScreenScenarioType } from '../../../core/rtc/type';
6
6
  import { AgoraElectronRtcStreamPublishPoolImpl } from './publish-pool';
7
7
  import { AgoraRtcSourceManager } from '../../../core/rtc/source-manager';
8
+ import { AgoraObservable } from '../../../imports';
8
9
  export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublisher {
9
10
  private _rtcEngine;
10
- protected logger: import("agora-foundation/lib/logger").Logger;
11
+ protected logger: import("agora-foundation/lib/logger/type").Logger;
12
+ protected observable: AgoraObservable<AgoraRtcChannelPublisherObserver>;
11
13
  protected publishPool: AgoraElectronRtcStreamPublishPoolImpl;
12
14
  protected sourceManager: AgoraRtcSourceManager;
13
15
  private _publishVideoMapping;
14
16
  private _publishAudioMapping;
17
+ private _connectionMapHandleLocalVideoStats;
15
18
  private _loopbackConnection;
16
19
  private _loopbackDeviceId;
17
20
  private _isLoopbackEnabled;
@@ -21,6 +24,7 @@ export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublish
21
24
  private _defaultScreenVideoEncoderConfig;
22
25
  private _screenCaptureDeviceTypeMap;
23
26
  private _sourceManagerObserver;
27
+ private _createHandleLocalVideoStats;
24
28
  private _publishPoolObserver;
25
29
  constructor(_rtcEngine: IRtcEngineEx, mainConnection: AgoraRtcConnection, latencyLevel: AgoraRtcLatencyLevelType, sourceManager: AgoraRtcSourceManager, config: AgoraElectronRtcChannelPublisherInitConfig);
26
30
  release(): void;
@@ -32,6 +36,8 @@ export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublish
32
36
  publishLocalAudioStream(token: string | undefined, streamId: string, sourceId: string, type: AgoraRtcAudioSourceType): number;
33
37
  unpublishLocalAudioStream(streamId: string, type: AgoraRtcAudioSourceType): number;
34
38
  setScreenScenario(type: AgoraRtcScreenScenarioType): number;
39
+ addObserver(observer: AgoraRtcChannelPublisherObserver): void;
40
+ removeObserver(observer: AgoraRtcChannelPublisherObserver): void;
35
41
  /**
36
42
  * Private Methods
37
43
  */
@@ -45,7 +51,6 @@ export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublish
45
51
  private _getCameraState;
46
52
  private _getAudioState;
47
53
  private _enableLoopbackRecording;
48
- private _adjustLoopbackSignalVolume;
49
54
  private _ifSetVideoEncoderConfigByStreamId;
50
55
  private _ifSetVideoEncoderConfigDualStreamByStorage;
51
56
  private _addVideoEncoderConfigStorage;
@@ -6,7 +6,6 @@ require("core-js/modules/es.symbol.iterator.js");
6
6
  require("core-js/modules/es.symbol.to-primitive.js");
7
7
  require("core-js/modules/es.error.cause.js");
8
8
  require("core-js/modules/es.array.filter.js");
9
- require("core-js/modules/es.array.for-each.js");
10
9
  require("core-js/modules/es.array.from.js");
11
10
  require("core-js/modules/es.array.is-array.js");
12
11
  require("core-js/modules/es.array.push.js");
@@ -26,9 +25,7 @@ require("core-js/modules/es.regexp.exec.js");
26
25
  require("core-js/modules/es.regexp.test.js");
27
26
  require("core-js/modules/esnext.function.metadata.js");
28
27
  require("core-js/modules/esnext.iterator.filter.js");
29
- require("core-js/modules/esnext.iterator.for-each.js");
30
28
  require("core-js/modules/esnext.symbol.metadata.js");
31
- require("core-js/modules/web.dom-collections.for-each.js");
32
29
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
33
30
  var _typeof = require("@babel/runtime/helpers/typeof");
34
31
  Object.defineProperty(exports, "__esModule", {
@@ -37,19 +34,18 @@ Object.defineProperty(exports, "__esModule", {
37
34
  exports.AgoraRtcChannelPublisherImpl = void 0;
38
35
  require("core-js/modules/es.error.to-string.js");
39
36
  require("core-js/modules/es.array.concat.js");
37
+ require("core-js/modules/es.array.for-each.js");
40
38
  require("core-js/modules/es.array.iterator.js");
41
- require("core-js/modules/es.array.some.js");
42
39
  require("core-js/modules/es.date.to-json.js");
43
40
  require("core-js/modules/es.date.to-string.js");
44
41
  require("core-js/modules/es.json.stringify.js");
45
42
  require("core-js/modules/es.map.js");
46
43
  require("core-js/modules/es.object.assign.js");
47
44
  require("core-js/modules/es.object.to-string.js");
48
- require("core-js/modules/es.object.values.js");
49
45
  require("core-js/modules/es.regexp.to-string.js");
50
46
  require("core-js/modules/es.string.iterator.js");
51
47
  require("core-js/modules/esnext.iterator.constructor.js");
52
- require("core-js/modules/esnext.iterator.some.js");
48
+ require("core-js/modules/esnext.iterator.for-each.js");
53
49
  require("core-js/modules/esnext.map.delete-all.js");
54
50
  require("core-js/modules/esnext.map.emplace.js");
55
51
  require("core-js/modules/esnext.map.every.js");
@@ -64,6 +60,7 @@ require("core-js/modules/esnext.map.merge.js");
64
60
  require("core-js/modules/esnext.map.reduce.js");
65
61
  require("core-js/modules/esnext.map.some.js");
66
62
  require("core-js/modules/esnext.map.update.js");
63
+ require("core-js/modules/web.dom-collections.for-each.js");
67
64
  require("core-js/modules/web.dom-collections.iterator.js");
68
65
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
69
66
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -81,7 +78,7 @@ var _constant = require("../../../constant");
81
78
  var _publishPool = require("./publish-pool");
82
79
  var _misc = require("agora-foundation/lib/utilities/misc");
83
80
  var _env = require("agora-foundation/lib/utilities/env");
84
- var _constants = require("./constants");
81
+ var _imports = require("../../../imports");
85
82
  var _AgoraRtcChannelPublisherImpl;
86
83
  var _initProto;
87
84
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
@@ -104,8 +101,10 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
104
101
  (0, _defineProperty2["default"])(_this, "logger", (_initProto(_this), (0, _logger.createLogger)({
105
102
  prefix: 'AgoraRtcChannelPublisherImpl'
106
103
  })));
104
+ (0, _defineProperty2["default"])(_this, "observable", new _imports.AgoraObservable());
107
105
  (0, _defineProperty2["default"])(_this, "_publishVideoMapping", new Map());
108
106
  (0, _defineProperty2["default"])(_this, "_publishAudioMapping", new Map());
107
+ (0, _defineProperty2["default"])(_this, "_connectionMapHandleLocalVideoStats", new Map());
109
108
  (0, _defineProperty2["default"])(_this, "_loopbackConnection", undefined);
110
109
  (0, _defineProperty2["default"])(_this, "_loopbackDeviceId", undefined);
111
110
  (0, _defineProperty2["default"])(_this, "_isLoopbackEnabled", false);
@@ -125,6 +124,15 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
125
124
  _this.publishPool.updateAudioSource(deivceId, _type3.AgoraRtcAudioSourceType.LOOPBACK, state);
126
125
  }
127
126
  });
127
+ (0, _defineProperty2["default"])(_this, "_createHandleLocalVideoStats", function (connection) {
128
+ var observableConnection = connection;
129
+ return function (connection, stats) {
130
+ if (observableConnection.localUid !== connection.localUid) {
131
+ return;
132
+ }
133
+ _this.observable.notifyObservers('onLocalVideoStatsUpdated', stats);
134
+ };
135
+ });
128
136
  (0, _defineProperty2["default"])(_this, "_publishPoolObserver", {
129
137
  onConnectionJoinChannel: function onConnectionJoinChannel(item) {
130
138
  if (!item.token) {
@@ -136,7 +144,14 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
136
144
  var _callback = function callback(connection) {
137
145
  if (connection.channelId !== item.connection.channelId) return;
138
146
  _this._rtcEngine.removeListener('onJoinChannelSuccess', _callback);
147
+ var oldHandleLocalVideoStats = _this._connectionMapHandleLocalVideoStats.get(item.connection.localUid);
148
+ if (oldHandleLocalVideoStats) {
149
+ _this._rtcEngine.removeListener('onLocalVideoStats', oldHandleLocalVideoStats);
150
+ }
139
151
  _this._joinSuccessCallback = undefined;
152
+ var handleLocalVideoStats = _this._createHandleLocalVideoStats(item.connection);
153
+ _this._connectionMapHandleLocalVideoStats.set(item.connection.localUid, handleLocalVideoStats);
154
+ _this._rtcEngine.addListener('onLocalVideoStats', handleLocalVideoStats);
140
155
  };
141
156
  _this._rtcEngine.addListener('onJoinChannelSuccess', _callback);
142
157
  _this._joinSuccessCallback = _callback;
@@ -166,6 +181,9 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
166
181
 
167
182
  if (_this._joinSuccessCallback) {
168
183
  _this._rtcEngine.removeListener('onJoinChannelSuccess', _this._joinSuccessCallback);
184
+ var handleLocalVideoStats = _this._connectionMapHandleLocalVideoStats.get(item.connection.localUid);
185
+ _this._rtcEngine.removeListener('onLocalVideoStats', handleLocalVideoStats);
186
+ _this._connectionMapHandleLocalVideoStats["delete"](item.connection.localUid);
169
187
  }
170
188
  _this._rtcEngine.leaveChannelEx(item.connection);
171
189
  if (item.audioSourceType === _type3.AgoraRtcAudioSourceType.LOOPBACK) {
@@ -227,6 +245,7 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
227
245
  return (0, _createClass2["default"])(AgoraRtcChannelPublisherImpl, [{
228
246
  key: "release",
229
247
  value: function release() {
248
+ this.publishPool.release();
230
249
  this._removeListeners();
231
250
  }
232
251
  }, {
@@ -326,7 +345,6 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
326
345
  if (state == _type3.AgoraRtcMediaSourceState.ERROR) {
327
346
  continue;
328
347
  }
329
- this._adjustLoopbackSignalVolume();
330
348
  this.publishPool.publishAudio(token, streamId, sourceId, type, state);
331
349
  }
332
350
  } catch (err) {
@@ -404,9 +422,6 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
404
422
  sourceId: sourceId,
405
423
  type: type
406
424
  });
407
-
408
- // 发流本地音频流时,调整共享音频的音量
409
- this._adjustLoopbackSignalVolume();
410
425
  return this.publishPool.publishAudio(token, streamId, sourceId, type, state);
411
426
  }
412
427
  }, {
@@ -416,7 +431,6 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
416
431
  this._rtcEngine.setAudioScenario(8);
417
432
  }
418
433
  this._publishAudioMapping["delete"](streamId);
419
- this._adjustLoopbackSignalVolume();
420
434
  return this.publishPool.unpublishAudio(streamId, type);
421
435
  }
422
436
  }, {
@@ -431,6 +445,16 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
431
445
  }
432
446
  return _constant.AgoraRtcErrorCode.UNSUPPORT_SCENARIO_TYPE;
433
447
  }
448
+ }, {
449
+ key: "addObserver",
450
+ value: function addObserver(observer) {
451
+ this.observable.addObserver(observer);
452
+ }
453
+ }, {
454
+ key: "removeObserver",
455
+ value: function removeObserver(observer) {
456
+ this.observable.removeObserver(observer);
457
+ }
434
458
 
435
459
  /**
436
460
  * Private Methods
@@ -444,8 +468,13 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
444
468
  }, {
445
469
  key: "_removeListeners",
446
470
  value: function _removeListeners() {
471
+ var _this2 = this;
447
472
  this.sourceManager.removeObserver(this._sourceManagerObserver);
448
473
  this.publishPool.removeObserver(this._publishPoolObserver);
474
+ this._connectionMapHandleLocalVideoStats.forEach(function (handleLocalVideoStats) {
475
+ _this2._rtcEngine.removeListener('onLocalVideoStats', handleLocalVideoStats);
476
+ });
477
+ this._connectionMapHandleLocalVideoStats.clear();
449
478
  }
450
479
  }, {
451
480
  key: "_setLoopbackRecordingState",
@@ -536,22 +565,6 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
536
565
  } else {
537
566
  this._rtcEngine.enableLoopbackRecordingEx(connection, enabled);
538
567
  }
539
- this._adjustLoopbackSignalVolume();
540
- }
541
- }
542
- }, {
543
- key: "_adjustLoopbackSignalVolume",
544
- value: function _adjustLoopbackSignalVolume() {
545
- if (!this._isLoopbackEnabled) {
546
- return;
547
- }
548
- var isReduceLoopbackVolume = Object.values(this._publishAudioMapping).some(function (item) {
549
- return item.type === _type3.AgoraRtcAudioSourceType.MICROPHONE;
550
- });
551
- if (isReduceLoopbackVolume) {
552
- this._rtcEngine.adjustLoopbackSignalVolume(_constants.REDUCE_LOOPBACK_VOLUME_MICROPHONE);
553
- } else {
554
- this._rtcEngine.adjustLoopbackSignalVolume(_constants.REDUCE_LOOPBACK_VOLUME);
555
568
  }
556
569
  }
557
570
 
@@ -579,9 +592,9 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
579
592
  } else {
580
593
  if (videoSourceType === _type3.AgoraRtcVideoSourceType.CAMERA) {
581
594
  if (streamType === _type3.AgoraRtcVideoStreamType.HIGH_STREAM) {
582
- videoEncoderConfig = this._defaultCameraLowVideoEncoderConfig;
583
- } else {
584
595
  videoEncoderConfig = this._defaultCameraHighVideoEncoderConfig;
596
+ } else {
597
+ videoEncoderConfig = this._defaultCameraLowVideoEncoderConfig;
585
598
  }
586
599
  } else if (videoSourceType === _type3.AgoraRtcVideoSourceType.SCREEN) {
587
600
  videoEncoderConfig = this._defaultScreenVideoEncoderConfig;
@@ -811,7 +811,7 @@ var AgoraRtcSourceManagerImpl = exports.AgoraRtcSourceManagerImpl = /*#__PURE__*
811
811
  width: this._screenCaptureParams.dimensions.width,
812
812
  height: this._screenCaptureParams.dimensions.height,
813
813
  frameRate: this._screenCaptureParams.frameRate,
814
- bitrate: 0,
814
+ bitrate: this._screenCaptureParams.bitrate,
815
815
  captureMouseCursor: true,
816
816
  windowFocus: true,
817
817
  highLightWidth: 4,
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.startVideoRender = exports.setVideoEncoderConfig = exports.resolveDomainLimit = exports.resolveDefaultLogsPath = exports.mapRegionToAreaCode = exports.loadElectronSdk = exports.isHTMLElement = exports.diffMap = exports.defaultWindowIconSize = exports.defaultThumbSize = exports.defaultDisplayIconSize = exports.createVideoRendererPlacement = exports.convertSourceIndexToSourceType = exports.convertSourceIndexToMediaSourceType = exports.convertRenderTypeToSetupMode = exports.convertCameraSourceTypeToPublishConfig = exports.cameraVideoSourceTypes = exports.VOLUME_INDICATION_SMOOTH = exports.VOLUME_INDICATION_INTERVAL = exports.VIDEO_PLACEMENT_REF_CLASSNAME = void 0;
9
+ require("core-js/modules/es.error.to-string.js");
9
10
  require("core-js/modules/es.array.concat.js");
10
11
  require("core-js/modules/es.array.from.js");
11
12
  require("core-js/modules/es.array.iterator.js");
12
13
  require("core-js/modules/es.date.to-json.js");
14
+ require("core-js/modules/es.date.to-string.js");
13
15
  require("core-js/modules/es.function.bind.js");
14
16
  require("core-js/modules/es.json.stringify.js");
15
17
  require("core-js/modules/es.number.constructor.js");
16
18
  require("core-js/modules/es.object.assign.js");
17
19
  require("core-js/modules/es.object.to-string.js");
20
+ require("core-js/modules/es.regexp.to-string.js");
18
21
  require("core-js/modules/es.string.iterator.js");
19
22
  require("core-js/modules/web.dom-collections.iterator.js");
20
23
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -391,7 +394,8 @@ var setHighStreamEncoderConfig = function setHighStreamEncoderConfig(config, rtc
391
394
  encodingPreference: encodingPreference
392
395
  }
393
396
  };
394
- logger.info("[setVideoEncoderConfig][smooth-first]: stream type is HIGH_STREAM, call setVideoEncoderConfigurationEx: ".concat(JSON.stringify(params)));
397
+ var streamId = rtcConnection.localUid.toString();
398
+ logger.info("[setVideoEncoderConfigurationEx]: stream type is HIGH_STREAM, call setVideoEncoderConfigurationEx: ".concat(JSON.stringify(params), ", streamId: ").concat(streamId));
395
399
  return rtcEngine.setVideoEncoderConfigurationEx(params, rtcConnection);
396
400
  };
397
401
 
@@ -409,7 +413,8 @@ var setLowStreamEncoderConfig = function setLowStreamEncoderConfig(config, rtcEn
409
413
  framerate: frameRate
410
414
  };
411
415
  rtcEngine.setDualStreamModeEx(dualStreamMode, params, rtcConnection);
412
- logger.info("[setVideoEncoderConfig][smooth-first]: stream type is LOW_STREAM, call setParametersEx: ".concat(JSON.stringify(params)));
416
+ var streamId = rtcConnection.localUid.toString();
417
+ logger.info("[setVideoEncoderConfigurationEx]: stream type is LOW_STREAM, call setVideoEncoderConfigurationEx: ".concat(JSON.stringify(params), ", streamId: ").concat(streamId));
413
418
  return rtcEngine.setParametersEx(rtcConnection, JSON.stringify(params));
414
419
  };
415
420
 
@@ -47,6 +47,7 @@ var _microphone = require("./track-control/microphone");
47
47
  var _screen = require("./track-control/screen");
48
48
  var _agoraExtensionAiDenoiser = require("agora-extension-ai-denoiser");
49
49
  var _logger = require("../../../core/utilities/logger");
50
+ var _logger2 = require("agora-foundation/lib/utilities/logger");
50
51
  var AgoraRtcDeviceManager = exports.AgoraRtcDeviceManager = /*#__PURE__*/function () {
51
52
  function AgoraRtcDeviceManager(_extensionDelegate, _dualCameraVideoStreamConfig, _dualScreenVideoStreamConfig) {
52
53
  (0, _classCallCheck2["default"])(this, AgoraRtcDeviceManager);
@@ -85,6 +86,7 @@ var AgoraRtcDeviceManager = exports.AgoraRtcDeviceManager = /*#__PURE__*/functio
85
86
  _agoraRtcSdkNg["default"].on('playback-device-changed', this._handleSpeakerChanged);
86
87
  this._mediaDeviceStateUpdater = new AgoraMediaDeviceStateUpdater(this._localTrackObservable, this._observable);
87
88
  _agoraRtcSdkNg["default"].registerExtensions(_extensionDelegate.getExtensions());
89
+ this._localTrackObservable.addObserver((0, _logger2.generateLogObserver)(this.logger, ['onLocalVideoTrackBeforeCreate', 'onLocalVideoTrackCreated', 'onLocalVideoTrackFailedToCreate', 'onLocalVideoTrackBeforeDestroy']));
88
90
  }
89
91
  return (0, _createClass2["default"])(AgoraRtcDeviceManager, [{
90
92
  key: "getVideoTracksMap",
@@ -185,8 +187,10 @@ var AgoraRtcDeviceManager = exports.AgoraRtcDeviceManager = /*#__PURE__*/functio
185
187
  this._microphoneControls.forEach(function (control) {
186
188
  return control.stop();
187
189
  });
188
- this._mediaDeviceStateUpdater.release();
189
190
  this._cameraControls.clear();
191
+ this._screenControls.clear();
192
+ this._microphoneControls.clear();
193
+ this._mediaDeviceStateUpdater.release();
190
194
  }
191
195
  }, {
192
196
  key: "setBeautyOptions",
@@ -491,7 +495,6 @@ var AgoraRtcDeviceManager = exports.AgoraRtcDeviceManager = /*#__PURE__*/functio
491
495
  key: "stopScreenCapture",
492
496
  value: function stopScreenCapture() {
493
497
  var screenControls = new Map(this._screenControls);
494
- this._screenControls.clear();
495
498
  screenControls.forEach(function (control) {
496
499
  control.stop();
497
500
  });
@@ -721,6 +724,7 @@ var AgoraMediaDeviceStateUpdater = /*#__PURE__*/function () {
721
724
  _this._deviceManagerObservable.notifyObservers('onScreenCaptureStateUpdated', sourceId, _type.AgoraRtcScreenCaptureType.SCREEN, _type.AgoraRtcMediaSourceState.ERROR
722
725
  // error,
723
726
  );
727
+ _this._deviceManagerObservable.notifyObservers('onScreenCaptureStateUpdated', sourceId, _type.AgoraRtcScreenCaptureType.SCREEN, _type.AgoraRtcMediaSourceState.CLOSE);
724
728
  }
725
729
  });
726
730
  (0, _defineProperty2["default"])(this, "_handleLocalAudioTrackBeforeDestroy", function (sourceId, sourceType) {
@@ -327,7 +327,7 @@ var AgoraRtcPublishManager = exports.AgoraRtcPublishManager = /*#__PURE__*/funct
327
327
  value: function () {
328
328
  var _syncState2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
329
329
  var _this2 = this;
330
- var rerun, localVideoTracks, localAudioTracks, videoPublishMap, audioPublishMap, videoDeviceStateMap, audioDeviceStateMap, noPublish, _iterator2, _step2, _loop, _iterator3, _step3, _loop2, _iterator4, _step4, _loop3, _iterator5, _step5, _loop4, _t, _t2, _t3, _t4, _t5;
330
+ var rerun, localVideoTracks, localAudioTracks, videoPublishMap, audioPublishMap, videoDeviceStateMap, audioDeviceStateMap, destroyedLocalVideoTracks, destroyedLocalAudioTracks, noPublish, _iterator2, _step2, _loop, _iterator3, _step3, _loop2, _iterator4, _step4, _loop3, _iterator5, _step5, _loop4, _t, _t2, _t3, _t4, _t5;
331
331
  return _regenerator["default"].wrap(function (_context5) {
332
332
  while (1) switch (_context5.prev = _context5.next) {
333
333
  case 0:
@@ -345,10 +345,14 @@ var AgoraRtcPublishManager = exports.AgoraRtcPublishManager = /*#__PURE__*/funct
345
345
  audioPublishMap = this._cloneMap(this._audioPublishMap);
346
346
  videoDeviceStateMap = this._cloneMap(this._videoDeviceStateMap);
347
347
  audioDeviceStateMap = this._cloneMap(this._audioDeviceStateMap);
348
+ destroyedLocalVideoTracks = new Map(this._destroyedLocalVideoTracks);
349
+ destroyedLocalAudioTracks = new Map(this._destroyedLocalAudioTracks);
350
+ this._destroyedLocalVideoTracks = new Map();
351
+ this._destroyedLocalAudioTracks = new Map();
348
352
  _context5.prev = 2;
349
353
  this._isProcessing = true;
350
354
  noPublish = true;
351
- _iterator2 = _createForOfIteratorHelper(this._destroyedLocalVideoTracks.values());
355
+ _iterator2 = _createForOfIteratorHelper(destroyedLocalVideoTracks.values());
352
356
  _context5.prev = 3;
353
357
  _loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
354
358
  var track, isTrackPublishing;
@@ -393,7 +397,7 @@ var AgoraRtcPublishManager = exports.AgoraRtcPublishManager = /*#__PURE__*/funct
393
397
  _iterator2.f();
394
398
  return _context5.finish(8);
395
399
  case 9:
396
- _iterator3 = _createForOfIteratorHelper(this._destroyedLocalAudioTracks.values());
400
+ _iterator3 = _createForOfIteratorHelper(destroyedLocalAudioTracks.values());
397
401
  _context5.prev = 10;
398
402
  _loop2 = /*#__PURE__*/_regenerator["default"].mark(function _loop2() {
399
403
  var track, isTrackPublishing;
@@ -1,7 +1,7 @@
1
1
  import { IAgoraRTCClient } from 'agora-rtc-sdk-ng';
2
2
  import { AgoraRtcChannelPublisher } from '../../../core/rtc/publisher';
3
3
  import { AgoraRtcSourceManager } from '../../../core/rtc/source-manager';
4
- import { AgoraRtcChannelClientObserver, AgoraRtcConnection, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoStreamType, AgoraRtcScreenScenarioType } from '../../../core/rtc/type';
4
+ import { AgoraRtcChannelClientObserver, AgoraRtcConnection, AgoraRtcVideoEncoderConfiguration, AgoraRtcVideoStreamType, AgoraRtcScreenScenarioType, AgoraRtcChannelPublisherObserver } from '../../../core/rtc/type';
5
5
  import { AgoraRteVideoSourceType, AgoraRteAudioSourceType } from '../../../type';
6
6
  import { AgoraWebRtcStreamPublishPoolImpl } from './publish-pool';
7
7
  import { AgoraWebRtcChannelClientInitConfig } from './type';
@@ -13,6 +13,7 @@ export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublish
13
13
  private _initConfig;
14
14
  private _deviceManager;
15
15
  private _channelObservable;
16
+ protected observable: AgoraObservable<AgoraRtcChannelPublisherObserver>;
16
17
  protected sourceManager: AgoraRtcSourceManager;
17
18
  private _mainPublishManager;
18
19
  private _publishManagerBinderMap;
@@ -34,4 +35,6 @@ export declare class AgoraRtcChannelPublisherImpl extends AgoraRtcChannelPublish
34
35
  resume(): void;
35
36
  setScreenScenario(type: AgoraRtcScreenScenarioType): AgoraRtcErrorCode;
36
37
  setVideoEncoderConfig(config: AgoraRtcVideoEncoderConfiguration, streamType: AgoraRtcVideoStreamType, streamId: string): number;
38
+ addObserver(observer: AgoraRtcChannelPublisherObserver): void;
39
+ removeObserver(observer: AgoraRtcChannelPublisherObserver): void;
37
40
  }
@@ -94,6 +94,7 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
94
94
  (0, _defineProperty2["default"])(_this, "logger", (_initProto(_this), (0, _logger.createLogger)({
95
95
  prefix: 'AgoraRtcChannelPublisherImpl'
96
96
  })));
97
+ (0, _defineProperty2["default"])(_this, "observable", new _imports.AgoraObservable());
97
98
  // map of sub rtc clients by connection
98
99
  (0, _defineProperty2["default"])(_this, "_publishManagerBinderMap", new Map());
99
100
  (0, _defineProperty2["default"])(_this, "_publishVideoMapping", new Map());
@@ -353,6 +354,16 @@ var AgoraRtcChannelPublisherImpl = exports.AgoraRtcChannelPublisherImpl = /*#__P
353
354
  this._mainPublishManager.setVideoEncoderConfig(streamId, config);
354
355
  return _constant.AgoraRtcErrorCode.SUCCESS;
355
356
  }
357
+ }, {
358
+ key: "addObserver",
359
+ value: function addObserver(observer) {
360
+ this.observable.addObserver(observer);
361
+ }
362
+ }, {
363
+ key: "removeObserver",
364
+ value: function removeObserver(observer) {
365
+ this.observable.removeObserver(observer);
366
+ }
356
367
  }]);
357
368
  }(_publisher.AgoraRtcChannelPublisher);
358
369
  _AgoraRtcChannelPublisherImpl = AgoraRtcChannelPublisherImpl;
@@ -253,6 +253,7 @@ var AgoraRtcCameraControl = exports.AgoraRtcCameraControl = /*#__PURE__*/functio
253
253
  }, {
254
254
  key: "setVirtualBackgroundOptions",
255
255
  value: function setVirtualBackgroundOptions(options) {
256
+ this._syncState();
256
257
  this._videoContexts.forEach(function (context) {
257
258
  context.virtualBackgroundEnabler.setVirtualBackgroundOptions(options);
258
259
  });
@@ -261,6 +262,9 @@ var AgoraRtcCameraControl = exports.AgoraRtcCameraControl = /*#__PURE__*/functio
261
262
  }, {
262
263
  key: "enableVirtualBackground",
263
264
  value: function enableVirtualBackground() {
265
+ // 虚拟背景的操作无法对clone出来的track生效,所以需要重新同步状态
266
+ // jira:https://jira.agoralab.co/browse/APAAS-11932
267
+ this._syncState();
264
268
  this._videoContexts.forEach(function (context) {
265
269
  context.virtualBackgroundEnabler.enable();
266
270
  });
@@ -269,6 +273,8 @@ var AgoraRtcCameraControl = exports.AgoraRtcCameraControl = /*#__PURE__*/functio
269
273
  }, {
270
274
  key: "disableVirtualBackground",
271
275
  value: function disableVirtualBackground() {
276
+ // 虚拟背景的操作无法对clone出来的track生效,所以需要重新同步状态
277
+ this._syncState();
272
278
  this._videoContexts.forEach(function (context) {
273
279
  context.virtualBackgroundEnabler.disable();
274
280
  });
@@ -278,8 +278,10 @@ var AgoraRtcScreenControl = exports.AgoraRtcScreenControl = /*#__PURE__*/functio
278
278
  key: "stop",
279
279
  value: function stop() {
280
280
  var _this2 = this;
281
- this._videoTracks.forEach(function (track, sourceId) {
282
- _this2._localTrackObservable.notifyObservers('onLocalVideoTrackBeforeDestroy', _this2._sourceId, _type.AgoraRtcVideoSourceType.SCREEN, track);
281
+ this._videoTracks.forEach(function (track, canvasKey) {
282
+ if (canvasKey === AgoraRtcScreenControl._DEFAULT_TRACK_KEY_) {
283
+ _this2._localTrackObservable.notifyObservers('onLocalVideoTrackBeforeDestroy', _this2._sourceId, _type.AgoraRtcVideoSourceType.SCREEN, track);
284
+ }
283
285
  track.stop();
284
286
  track.close();
285
287
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-rte-sdk",
3
- "version": "3.7.5",
3
+ "version": "3.7.6",
4
4
  "description": "SDK for building interactive scenarios",
5
5
  "author": "agora.io",
6
6
  "license": "ISC",
@@ -28,7 +28,7 @@
28
28
  "@types/sinon": "^17.0.2",
29
29
  "@types/ua-parser-js": "^0.7.35",
30
30
  "agora-token": "^2.0.3",
31
- "agora-toolchain": "~3.7.5",
31
+ "agora-toolchain": "~3.7.6",
32
32
  "core-js": "^3.33.3",
33
33
  "electron": "22.3.27",
34
34
  "husky": "^9.0.11",
@@ -43,9 +43,9 @@
43
43
  "agora-extension-ai-denoiser": "^1.0.0",
44
44
  "agora-extension-beauty-effect": "^1.0.1-beta",
45
45
  "agora-extension-virtual-background": "^2.1.0",
46
- "agora-foundation": "~3.7.5",
46
+ "agora-foundation": "~3.7.6",
47
47
  "agora-rtc-sdk-ng": "4.23.3",
48
- "agora-rtm": "2.2.2-2",
48
+ "agora-rtm": "2.2.2-3",
49
49
  "await-to-js": "^3.0.0",
50
50
  "immutable": "^4.3.7",
51
51
  "lodash": "^4.17.21",