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.
- package/lib/core/rtc/publisher.d.ts +3 -1
- package/lib/core/rtc/type.d.ts +3 -0
- package/lib/core/scene/local-user.js +2 -2
- package/lib/core/services/api.d.ts +16 -1
- package/lib/core/services/api.js +127 -96
- package/lib/plugin/rtc/electron/channel.d.ts +2 -0
- package/lib/plugin/rtc/electron/channel.js +21 -9
- package/lib/plugin/rtc/electron/dowloadALD.d.ts +3 -0
- package/lib/plugin/rtc/electron/dowloadALD.js +105 -0
- package/lib/plugin/rtc/electron/loopback-mixer.d.ts +12 -0
- package/lib/plugin/rtc/electron/loopback-mixer.js +45 -0
- package/lib/plugin/rtc/electron/parameters.d.ts +4 -0
- package/lib/plugin/rtc/electron/parameters.js +57 -0
- package/lib/plugin/rtc/electron/publish-pool.d.ts +1 -0
- package/lib/plugin/rtc/electron/publish-pool.js +19 -0
- package/lib/plugin/rtc/electron/publisher.d.ts +8 -3
- package/lib/plugin/rtc/electron/publisher.js +48 -31
- package/lib/plugin/rtc/electron/source-manager.js +5 -4
- package/lib/plugin/rtc/electron/utils.d.ts +1 -0
- package/lib/plugin/rtc/electron/utils.js +12 -3
- package/lib/plugin/rtc/web/channel.js +2 -0
- package/lib/plugin/rtc/web/device.js +6 -2
- package/lib/plugin/rtc/web/publish.js +7 -3
- package/lib/plugin/rtc/web/publisher.d.ts +4 -1
- package/lib/plugin/rtc/web/publisher.js +13 -0
- package/lib/plugin/rtc/web/track-control/camera.js +6 -0
- package/lib/plugin/rtc/web/track-control/screen.js +4 -2
- package/package.json +4 -4
|
@@ -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
|
}
|
package/lib/core/rtc/type.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
-
|
|
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;
|
package/lib/core/services/api.js
CHANGED
|
@@ -420,9 +420,9 @@ var AgoraRteServiceApi = exports.AgoraRteServiceApi = /*#__PURE__*/function () {
|
|
|
420
420
|
return upsertStream;
|
|
421
421
|
}()
|
|
422
422
|
}, {
|
|
423
|
-
key: "
|
|
423
|
+
key: "createStreamBatch",
|
|
424
424
|
value: function () {
|
|
425
|
-
var
|
|
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: '
|
|
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
|
|
449
|
-
return
|
|
448
|
+
function createStreamBatch(_x10) {
|
|
449
|
+
return _createStreamBatch.apply(this, arguments);
|
|
450
450
|
}
|
|
451
|
-
return
|
|
451
|
+
return createStreamBatch;
|
|
452
452
|
}()
|
|
453
453
|
}, {
|
|
454
|
-
key: "
|
|
454
|
+
key: "updateStreamBatch",
|
|
455
455
|
value: function () {
|
|
456
|
-
var
|
|
457
|
-
var roomUuid,
|
|
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,
|
|
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
|
|
509
|
+
return _context12.abrupt("return", _context12.sent);
|
|
479
510
|
case 2:
|
|
480
511
|
case "end":
|
|
481
|
-
return
|
|
512
|
+
return _context12.stop();
|
|
482
513
|
}
|
|
483
|
-
},
|
|
514
|
+
}, _callee12, this);
|
|
484
515
|
}));
|
|
485
|
-
function updateStreamBatchByCondition(
|
|
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
|
|
494
|
-
return _regenerator["default"].wrap(function (
|
|
495
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
|
534
|
+
return _context13.abrupt("return", _context13.sent);
|
|
504
535
|
case 2:
|
|
505
536
|
case "end":
|
|
506
|
-
return
|
|
537
|
+
return _context13.stop();
|
|
507
538
|
}
|
|
508
|
-
},
|
|
539
|
+
}, _callee13, this);
|
|
509
540
|
}));
|
|
510
|
-
function deleteStream(
|
|
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
|
|
519
|
-
return _regenerator["default"].wrap(function (
|
|
520
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
|
563
|
+
return _context14.abrupt("return", _context14.sent);
|
|
533
564
|
case 2:
|
|
534
565
|
case "end":
|
|
535
|
-
return
|
|
566
|
+
return _context14.stop();
|
|
536
567
|
}
|
|
537
|
-
},
|
|
568
|
+
}, _callee14, this);
|
|
538
569
|
}));
|
|
539
|
-
function deleteStreamBatch(
|
|
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
|
|
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 (
|
|
550
|
-
while (1) switch (
|
|
580
|
+
return _regenerator["default"].wrap(function (_context15) {
|
|
581
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
551
582
|
case 0:
|
|
552
|
-
roomUuid =
|
|
553
|
-
|
|
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
|
|
596
|
+
return _context15.abrupt("return", _context15.sent);
|
|
566
597
|
case 2:
|
|
567
598
|
case "end":
|
|
568
|
-
return
|
|
599
|
+
return _context15.stop();
|
|
569
600
|
}
|
|
570
|
-
},
|
|
601
|
+
}, _callee15, this);
|
|
571
602
|
}));
|
|
572
|
-
function updateStream(
|
|
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
|
|
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 (
|
|
583
|
-
while (1) switch (
|
|
613
|
+
return _regenerator["default"].wrap(function (_context16) {
|
|
614
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
584
615
|
case 0:
|
|
585
|
-
roomUuid =
|
|
586
|
-
|
|
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 =
|
|
597
|
-
return
|
|
627
|
+
res = _context16.sent;
|
|
628
|
+
return _context16.abrupt("return", res.data);
|
|
598
629
|
case 2:
|
|
599
630
|
case "end":
|
|
600
|
-
return
|
|
631
|
+
return _context16.stop();
|
|
601
632
|
}
|
|
602
|
-
},
|
|
633
|
+
}, _callee16, this);
|
|
603
634
|
}));
|
|
604
|
-
function sendRoomChatMessage(
|
|
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
|
|
613
|
-
var roomUuid, payload, cmd,
|
|
614
|
-
return _regenerator["default"].wrap(function (
|
|
615
|
-
while (1) switch (
|
|
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 =
|
|
618
|
-
|
|
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
|
|
662
|
+
return _context17.abrupt("return", _context17.sent);
|
|
632
663
|
case 2:
|
|
633
664
|
case "end":
|
|
634
|
-
return
|
|
665
|
+
return _context17.stop();
|
|
635
666
|
}
|
|
636
|
-
},
|
|
667
|
+
}, _callee17, this);
|
|
637
668
|
}));
|
|
638
|
-
function sendCustomChannelMessage(
|
|
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
|
|
647
|
-
var payload, toUserUuid,
|
|
648
|
-
return _regenerator["default"].wrap(function (
|
|
649
|
-
while (1) switch (
|
|
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 =
|
|
652
|
-
|
|
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
|
|
693
|
+
return _context18.abrupt("return", _context18.sent);
|
|
663
694
|
case 2:
|
|
664
695
|
case "end":
|
|
665
|
-
return
|
|
696
|
+
return _context18.stop();
|
|
666
697
|
}
|
|
667
|
-
},
|
|
698
|
+
}, _callee18, this);
|
|
668
699
|
}));
|
|
669
|
-
function sendCustomPeerMessage(
|
|
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
|
|
708
|
+
var _updateOnlineState = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19(_ref15) {
|
|
678
709
|
var userUuid, roomUuid;
|
|
679
|
-
return _regenerator["default"].wrap(function (
|
|
680
|
-
while (1) switch (
|
|
710
|
+
return _regenerator["default"].wrap(function (_context19) {
|
|
711
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
681
712
|
case 0:
|
|
682
|
-
userUuid =
|
|
683
|
-
|
|
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
|
|
720
|
+
return _context19.abrupt("return", _context19.sent);
|
|
690
721
|
case 2:
|
|
691
722
|
case "end":
|
|
692
|
-
return
|
|
723
|
+
return _context19.stop();
|
|
693
724
|
}
|
|
694
|
-
},
|
|
725
|
+
}, _callee19, this);
|
|
695
726
|
}));
|
|
696
|
-
function updateOnlineState(
|
|
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
|
|
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 (
|
|
707
|
-
while (1) switch (
|
|
737
|
+
return _regenerator["default"].wrap(function (_context20) {
|
|
738
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
708
739
|
case 0:
|
|
709
|
-
userRole =
|
|
710
|
-
|
|
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
|
|
754
|
+
return _context20.abrupt("return", _context20.sent);
|
|
724
755
|
case 2:
|
|
725
756
|
case "end":
|
|
726
|
-
return
|
|
757
|
+
return _context20.stop();
|
|
727
758
|
}
|
|
728
|
-
},
|
|
759
|
+
}, _callee20, this);
|
|
729
760
|
}));
|
|
730
|
-
function fetchUserList(
|
|
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
|
|
769
|
+
var _uploadEvent = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee21(_ref17) {
|
|
739
770
|
var userId, event;
|
|
740
|
-
return _regenerator["default"].wrap(function (
|
|
741
|
-
while (1) switch (
|
|
771
|
+
return _regenerator["default"].wrap(function (_context21) {
|
|
772
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
742
773
|
case 0:
|
|
743
|
-
userId =
|
|
744
|
-
|
|
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
|
|
786
|
+
return _context21.abrupt("return", _context21.sent);
|
|
756
787
|
case 2:
|
|
757
788
|
case "end":
|
|
758
|
-
return
|
|
789
|
+
return _context21.stop();
|
|
759
790
|
}
|
|
760
|
-
},
|
|
791
|
+
}, _callee21, this);
|
|
761
792
|
}));
|
|
762
|
-
function uploadEvent(
|
|
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: "
|
|
631
|
-
value: function
|
|
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;
|