@realsee/live 0.5.2-dev.2 → 0.5.2-dev.3
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 +17 -17
- 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 +17 -17
- package/dist/realsee-live.esm.js.map +1 -1
- package/dist/realsee-live.umd.development.js +17 -17
- 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/package.json +1 -1
|
@@ -1777,7 +1777,7 @@ class Live extends Subscribe {
|
|
|
1777
1777
|
* @param liveMsg
|
|
1778
1778
|
*/
|
|
1779
1779
|
this._handleMessage = (liveMsg) => __awaiter(this, void 0, void 0, function* () {
|
|
1780
|
-
var _b, _c, _d, _e, _f
|
|
1780
|
+
var _b, _c, _d, _e, _f;
|
|
1781
1781
|
if (typeof liveMsg === 'object') {
|
|
1782
1782
|
const { command, data = {}, frontRequestId, code, message } = liveMsg;
|
|
1783
1783
|
if (code === 'SUCCESS') {
|
|
@@ -1817,7 +1817,7 @@ class Live extends Subscribe {
|
|
|
1817
1817
|
}));
|
|
1818
1818
|
if (result) {
|
|
1819
1819
|
const status = (_f = this._options.initialMicroStatus) !== null && _f !== void 0 ? _f : exports.MicroStatus.OPEN;
|
|
1820
|
-
yield
|
|
1820
|
+
yield this.toggleMicro(status === exports.MicroStatus.OPEN);
|
|
1821
1821
|
}
|
|
1822
1822
|
else {
|
|
1823
1823
|
logger$1.error('加入语音房间失败');
|
|
@@ -1931,12 +1931,12 @@ class Live extends Subscribe {
|
|
|
1931
1931
|
* @returns
|
|
1932
1932
|
*/
|
|
1933
1933
|
this.connect = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1934
|
-
var _h, _j, _k
|
|
1934
|
+
var _g, _h, _j, _k;
|
|
1935
1935
|
// 检查 url 和 票据获取接口实现
|
|
1936
|
-
this._options.url = (
|
|
1937
|
-
this._options.getTicket = (
|
|
1936
|
+
this._options.url = (_h = (_g = options.url) !== null && _g !== void 0 ? _g : this._options.url) !== null && _h !== void 0 ? _h : '';
|
|
1937
|
+
this._options.getTicket = (_j = options.getTicket) !== null && _j !== void 0 ? _j : this._options.getTicket;
|
|
1938
1938
|
this._options.initialMicroStatus =
|
|
1939
|
-
(
|
|
1939
|
+
(_k = options.rtcMicStatus) !== null && _k !== void 0 ? _k : this._options.initialMicroStatus;
|
|
1940
1940
|
if (!/^ws(s):\/\//.test(this._options.url) ||
|
|
1941
1941
|
typeof this._options.getTicket !== 'function') {
|
|
1942
1942
|
if (!/^ws(s):\/\//.test(this._options.url)) {
|
|
@@ -1985,11 +1985,11 @@ class Live extends Subscribe {
|
|
|
1985
1985
|
* @returns
|
|
1986
1986
|
*/
|
|
1987
1987
|
this.exit = () => __awaiter(this, void 0, void 0, function* () {
|
|
1988
|
-
var
|
|
1988
|
+
var _l;
|
|
1989
1989
|
this._clearLiveData();
|
|
1990
1990
|
try {
|
|
1991
1991
|
/** 退出强制关闭语音 */
|
|
1992
|
-
(
|
|
1992
|
+
(_l = this.$RTC) === null || _l === void 0 ? void 0 : _l.quit();
|
|
1993
1993
|
yield this.updateStatus(exports.BuiltinEventType.RoomChange, exports.BuiltinActionType.RoomClose, {});
|
|
1994
1994
|
}
|
|
1995
1995
|
catch (e) {
|
|
@@ -2016,10 +2016,10 @@ class Live extends Subscribe {
|
|
|
2016
2016
|
});
|
|
2017
2017
|
// 仅用于用户自己的麦克风控制
|
|
2018
2018
|
this.toggleMicro = (microStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
2019
|
-
var _o, _p
|
|
2020
|
-
if (!((
|
|
2019
|
+
var _m, _o, _p;
|
|
2020
|
+
if (!((_o = (_m = this.selfInfo) === null || _m === void 0 ? void 0 : _m.permission) === null || _o === void 0 ? void 0 : _o.control_own_micro))
|
|
2021
2021
|
return false;
|
|
2022
|
-
const result = yield ((
|
|
2022
|
+
const result = yield ((_p = this.$RTC) === null || _p === void 0 ? void 0 : _p.toggleMicro(microStatus));
|
|
2023
2023
|
if (result) {
|
|
2024
2024
|
yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserMicroStatus, {
|
|
2025
2025
|
status: microStatus ? exports.MicroStatus.OPEN : exports.MicroStatus.CLOSE,
|
|
@@ -2034,12 +2034,12 @@ class Live extends Subscribe {
|
|
|
2034
2034
|
* @returns
|
|
2035
2035
|
*/
|
|
2036
2036
|
this.forbidMicro = (microStatus, toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2037
|
-
var
|
|
2037
|
+
var _q, _r;
|
|
2038
2038
|
if (typeof this._options.canForbidUserMicro === 'function' &&
|
|
2039
2039
|
!this._options.canForbidUserMicro(toUserIds)) {
|
|
2040
2040
|
return false;
|
|
2041
2041
|
}
|
|
2042
|
-
if (!((
|
|
2042
|
+
if (!((_r = (_q = this.selfInfo) === null || _q === void 0 ? void 0 : _q.permission) === null || _r === void 0 ? void 0 : _r.control_other_micro)) {
|
|
2043
2043
|
return false;
|
|
2044
2044
|
}
|
|
2045
2045
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserMicroStatus, {
|
|
@@ -2053,12 +2053,12 @@ class Live extends Subscribe {
|
|
|
2053
2053
|
* @returns
|
|
2054
2054
|
*/
|
|
2055
2055
|
this.forbidSync = (sync, toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2056
|
-
var
|
|
2056
|
+
var _s, _t;
|
|
2057
2057
|
if (typeof this._options.canForbidUserSync === 'function' &&
|
|
2058
2058
|
!this._options.canForbidUserSync(toUserIds)) {
|
|
2059
2059
|
return false;
|
|
2060
2060
|
}
|
|
2061
|
-
if (!((
|
|
2061
|
+
if (!((_t = (_s = this.selfInfo) === null || _s === void 0 ? void 0 : _s.permission) === null || _t === void 0 ? void 0 : _t.control_other_sync)) {
|
|
2062
2062
|
return false;
|
|
2063
2063
|
}
|
|
2064
2064
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserPermission, { sync_frame: sync }, toUserIds);
|
|
@@ -2069,12 +2069,12 @@ class Live extends Subscribe {
|
|
|
2069
2069
|
* @returns
|
|
2070
2070
|
*/
|
|
2071
2071
|
this.kick = (toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2072
|
-
var
|
|
2072
|
+
var _u, _v;
|
|
2073
2073
|
if (typeof this._options.canForbidUserKick === 'function' &&
|
|
2074
2074
|
!this._options.canForbidUserKick(toUserIds)) {
|
|
2075
2075
|
return false;
|
|
2076
2076
|
}
|
|
2077
|
-
if (!((
|
|
2077
|
+
if (!((_v = (_u = this.selfInfo) === null || _u === void 0 ? void 0 : _u.permission) === null || _v === void 0 ? void 0 : _v.change_other_status)) {
|
|
2078
2078
|
return false;
|
|
2079
2079
|
}
|
|
2080
2080
|
return yield this.updateStatus(exports.BuiltinEventType.UserChange, exports.BuiltinActionType.UserStatus, {
|