@realsee/live 0.5.2-dev.2 → 0.5.2-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/realsee-live.cjs.development.js +1883 -227
- package/dist/realsee-live.cjs.development.js.map +1 -1
- package/dist/realsee-live.cjs.production.js +1 -1
- package/dist/realsee-live.cjs.production.js.map +1 -1
- package/dist/realsee-live.esm.js +1882 -225
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +24 -23
- package/dist/realsee-live.umd.development.js.map +1 -1
- package/dist/realsee-live.umd.production.js +1 -1
- package/dist/realsee-live.umd.production.js.map +1 -1
- package/docs/classes/BrowserRTC.html +3 -3
- package/package.json +2 -2
|
@@ -360,6 +360,7 @@
|
|
|
360
360
|
this._trtc.stream = null;
|
|
361
361
|
}
|
|
362
362
|
(_b = this._trtc.client) === null || _b === void 0 ? void 0 : _b.leave().then(() => (this._trtc.client = null)).then(() => resolve(true)).catch(() => resolve(false));
|
|
363
|
+
resolve(true);
|
|
363
364
|
}));
|
|
364
365
|
}
|
|
365
366
|
detectMicro() {
|
|
@@ -49592,6 +49593,9 @@
|
|
|
49592
49593
|
}
|
|
49593
49594
|
|
|
49594
49595
|
class RobustWebSocket$1 extends Subscribe {
|
|
49596
|
+
get attempts() {
|
|
49597
|
+
return this._attempts;
|
|
49598
|
+
}
|
|
49595
49599
|
constructor(options) {
|
|
49596
49600
|
super();
|
|
49597
49601
|
this._options = {
|
|
@@ -49739,9 +49743,6 @@
|
|
|
49739
49743
|
this.setOptions(options);
|
|
49740
49744
|
}
|
|
49741
49745
|
}
|
|
49742
|
-
get attempts() {
|
|
49743
|
-
return this._attempts;
|
|
49744
|
-
}
|
|
49745
49746
|
setOptions(options) {
|
|
49746
49747
|
if (!options)
|
|
49747
49748
|
return;
|
|
@@ -49778,6 +49779,9 @@
|
|
|
49778
49779
|
}
|
|
49779
49780
|
|
|
49780
49781
|
class HybridBridge {
|
|
49782
|
+
get isReady() {
|
|
49783
|
+
return this._readyState === 'open';
|
|
49784
|
+
}
|
|
49781
49785
|
constructor() {
|
|
49782
49786
|
var _a, _b;
|
|
49783
49787
|
this._rsWeappBridgeMethodAdapter = {};
|
|
@@ -49960,9 +49964,6 @@
|
|
|
49960
49964
|
this.initBuiltInHandlers();
|
|
49961
49965
|
}
|
|
49962
49966
|
}
|
|
49963
|
-
get isReady() {
|
|
49964
|
-
return this._readyState === 'open';
|
|
49965
|
-
}
|
|
49966
49967
|
_registerBridgeRequestHandler() {
|
|
49967
49968
|
this._ws.on('message', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
49968
49969
|
const request = this._parseMessage(event);
|
|
@@ -51505,7 +51506,7 @@
|
|
|
51505
51506
|
* @param liveMsg
|
|
51506
51507
|
*/
|
|
51507
51508
|
this._handleMessage = (liveMsg) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51508
|
-
var _b, _c, _d, _e, _f
|
|
51509
|
+
var _b, _c, _d, _e, _f;
|
|
51509
51510
|
if (typeof liveMsg === 'object') {
|
|
51510
51511
|
const { command, data = {}, frontRequestId, code, message } = liveMsg;
|
|
51511
51512
|
if (code === 'SUCCESS') {
|
|
@@ -51545,7 +51546,7 @@
|
|
|
51545
51546
|
}));
|
|
51546
51547
|
if (result) {
|
|
51547
51548
|
const status = (_f = this._options.initialMicroStatus) !== null && _f !== void 0 ? _f : exports.MicroStatus.OPEN;
|
|
51548
|
-
yield
|
|
51549
|
+
yield this.toggleMicro(status === exports.MicroStatus.OPEN);
|
|
51549
51550
|
}
|
|
51550
51551
|
else {
|
|
51551
51552
|
logger$1.error('加入语音房间失败');
|
|
@@ -51659,12 +51660,12 @@
|
|
|
51659
51660
|
* @returns
|
|
51660
51661
|
*/
|
|
51661
51662
|
this.connect = (options = {}) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51662
|
-
var _h, _j, _k
|
|
51663
|
+
var _g, _h, _j, _k;
|
|
51663
51664
|
// 检查 url 和 票据获取接口实现
|
|
51664
|
-
this._options.url = (
|
|
51665
|
-
this._options.getTicket = (
|
|
51665
|
+
this._options.url = (_h = (_g = options.url) !== null && _g !== void 0 ? _g : this._options.url) !== null && _h !== void 0 ? _h : '';
|
|
51666
|
+
this._options.getTicket = (_j = options.getTicket) !== null && _j !== void 0 ? _j : this._options.getTicket;
|
|
51666
51667
|
this._options.initialMicroStatus =
|
|
51667
|
-
(
|
|
51668
|
+
(_k = options.rtcMicStatus) !== null && _k !== void 0 ? _k : this._options.initialMicroStatus;
|
|
51668
51669
|
if (!/^ws(s):\/\//.test(this._options.url) ||
|
|
51669
51670
|
typeof this._options.getTicket !== 'function') {
|
|
51670
51671
|
if (!/^ws(s):\/\//.test(this._options.url)) {
|
|
@@ -51713,11 +51714,11 @@
|
|
|
51713
51714
|
* @returns
|
|
51714
51715
|
*/
|
|
51715
51716
|
this.exit = () => __awaiter$10(this, void 0, void 0, function* () {
|
|
51716
|
-
var
|
|
51717
|
+
var _l;
|
|
51717
51718
|
this._clearLiveData();
|
|
51718
51719
|
try {
|
|
51719
51720
|
/** 退出强制关闭语音 */
|
|
51720
|
-
(
|
|
51721
|
+
(_l = this.$RTC) === null || _l === void 0 ? void 0 : _l.quit();
|
|
51721
51722
|
yield this.updateStatus(exports.BuiltinEventType.RoomChange, exports.BuiltinActionType.RoomClose, {});
|
|
51722
51723
|
}
|
|
51723
51724
|
catch (e) {
|
|
@@ -51744,10 +51745,10 @@
|
|
|
51744
51745
|
});
|
|
51745
51746
|
// 仅用于用户自己的麦克风控制
|
|
51746
51747
|
this.toggleMicro = (microStatus) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51747
|
-
var _o, _p
|
|
51748
|
-
if (!((
|
|
51748
|
+
var _m, _o, _p;
|
|
51749
|
+
if (!((_o = (_m = this.selfInfo) === null || _m === void 0 ? void 0 : _m.permission) === null || _o === void 0 ? void 0 : _o.control_own_micro))
|
|
51749
51750
|
return false;
|
|
51750
|
-
const result = yield ((
|
|
51751
|
+
const result = yield ((_p = this.$RTC) === null || _p === void 0 ? void 0 : _p.toggleMicro(microStatus));
|
|
51751
51752
|
if (result) {
|
|
51752
51753
|
yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserMicroStatus, {
|
|
51753
51754
|
status: microStatus ? exports.MicroStatus.OPEN : exports.MicroStatus.CLOSE,
|
|
@@ -51762,12 +51763,12 @@
|
|
|
51762
51763
|
* @returns
|
|
51763
51764
|
*/
|
|
51764
51765
|
this.forbidMicro = (microStatus, toUserIds) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51765
|
-
var
|
|
51766
|
+
var _q, _r;
|
|
51766
51767
|
if (typeof this._options.canForbidUserMicro === 'function' &&
|
|
51767
51768
|
!this._options.canForbidUserMicro(toUserIds)) {
|
|
51768
51769
|
return false;
|
|
51769
51770
|
}
|
|
51770
|
-
if (!((
|
|
51771
|
+
if (!((_r = (_q = this.selfInfo) === null || _q === void 0 ? void 0 : _q.permission) === null || _r === void 0 ? void 0 : _r.control_other_micro)) {
|
|
51771
51772
|
return false;
|
|
51772
51773
|
}
|
|
51773
51774
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserMicroStatus, {
|
|
@@ -51781,12 +51782,12 @@
|
|
|
51781
51782
|
* @returns
|
|
51782
51783
|
*/
|
|
51783
51784
|
this.forbidSync = (sync, toUserIds) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51784
|
-
var
|
|
51785
|
+
var _s, _t;
|
|
51785
51786
|
if (typeof this._options.canForbidUserSync === 'function' &&
|
|
51786
51787
|
!this._options.canForbidUserSync(toUserIds)) {
|
|
51787
51788
|
return false;
|
|
51788
51789
|
}
|
|
51789
|
-
if (!((
|
|
51790
|
+
if (!((_t = (_s = this.selfInfo) === null || _s === void 0 ? void 0 : _s.permission) === null || _t === void 0 ? void 0 : _t.control_other_sync)) {
|
|
51790
51791
|
return false;
|
|
51791
51792
|
}
|
|
51792
51793
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserPermission, { sync_frame: sync }, toUserIds);
|
|
@@ -51797,12 +51798,12 @@
|
|
|
51797
51798
|
* @returns
|
|
51798
51799
|
*/
|
|
51799
51800
|
this.kick = (toUserIds) => __awaiter$10(this, void 0, void 0, function* () {
|
|
51800
|
-
var
|
|
51801
|
+
var _u, _v;
|
|
51801
51802
|
if (typeof this._options.canForbidUserKick === 'function' &&
|
|
51802
51803
|
!this._options.canForbidUserKick(toUserIds)) {
|
|
51803
51804
|
return false;
|
|
51804
51805
|
}
|
|
51805
|
-
if (!((
|
|
51806
|
+
if (!((_v = (_u = this.selfInfo) === null || _u === void 0 ? void 0 : _u.permission) === null || _v === void 0 ? void 0 : _v.change_other_status)) {
|
|
51806
51807
|
return false;
|
|
51807
51808
|
}
|
|
51808
51809
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserStatus, {
|