agora-rte-sdk 3.7.5 → 3.7.7

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;
@@ -0,0 +1,3 @@
1
+ declare function downloadFile(url: string, destination: string): Promise<void>;
2
+ declare function getSpecificFiles(directory: string, extensions: string[], fileName?: string): any;
3
+ export { downloadFile, getSpecificFiles };