@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
package/dist/realsee-live.esm.js
CHANGED
|
@@ -1767,7 +1767,7 @@ class Live extends Subscribe {
|
|
|
1767
1767
|
* @param liveMsg
|
|
1768
1768
|
*/
|
|
1769
1769
|
this._handleMessage = (liveMsg) => __awaiter(this, void 0, void 0, function* () {
|
|
1770
|
-
var _b, _c, _d, _e, _f
|
|
1770
|
+
var _b, _c, _d, _e, _f;
|
|
1771
1771
|
if (typeof liveMsg === 'object') {
|
|
1772
1772
|
const { command, data = {}, frontRequestId, code, message } = liveMsg;
|
|
1773
1773
|
if (code === 'SUCCESS') {
|
|
@@ -1807,7 +1807,7 @@ class Live extends Subscribe {
|
|
|
1807
1807
|
}));
|
|
1808
1808
|
if (result) {
|
|
1809
1809
|
const status = (_f = this._options.initialMicroStatus) !== null && _f !== void 0 ? _f : MicroStatus.OPEN;
|
|
1810
|
-
yield
|
|
1810
|
+
yield this.toggleMicro(status === MicroStatus.OPEN);
|
|
1811
1811
|
}
|
|
1812
1812
|
else {
|
|
1813
1813
|
logger$1.error('加入语音房间失败');
|
|
@@ -1921,12 +1921,12 @@ class Live extends Subscribe {
|
|
|
1921
1921
|
* @returns
|
|
1922
1922
|
*/
|
|
1923
1923
|
this.connect = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1924
|
-
var _h, _j, _k
|
|
1924
|
+
var _g, _h, _j, _k;
|
|
1925
1925
|
// 检查 url 和 票据获取接口实现
|
|
1926
|
-
this._options.url = (
|
|
1927
|
-
this._options.getTicket = (
|
|
1926
|
+
this._options.url = (_h = (_g = options.url) !== null && _g !== void 0 ? _g : this._options.url) !== null && _h !== void 0 ? _h : '';
|
|
1927
|
+
this._options.getTicket = (_j = options.getTicket) !== null && _j !== void 0 ? _j : this._options.getTicket;
|
|
1928
1928
|
this._options.initialMicroStatus =
|
|
1929
|
-
(
|
|
1929
|
+
(_k = options.rtcMicStatus) !== null && _k !== void 0 ? _k : this._options.initialMicroStatus;
|
|
1930
1930
|
if (!/^ws(s):\/\//.test(this._options.url) ||
|
|
1931
1931
|
typeof this._options.getTicket !== 'function') {
|
|
1932
1932
|
if (!/^ws(s):\/\//.test(this._options.url)) {
|
|
@@ -1975,11 +1975,11 @@ class Live extends Subscribe {
|
|
|
1975
1975
|
* @returns
|
|
1976
1976
|
*/
|
|
1977
1977
|
this.exit = () => __awaiter(this, void 0, void 0, function* () {
|
|
1978
|
-
var
|
|
1978
|
+
var _l;
|
|
1979
1979
|
this._clearLiveData();
|
|
1980
1980
|
try {
|
|
1981
1981
|
/** 退出强制关闭语音 */
|
|
1982
|
-
(
|
|
1982
|
+
(_l = this.$RTC) === null || _l === void 0 ? void 0 : _l.quit();
|
|
1983
1983
|
yield this.updateStatus(BuiltinEventType.RoomChange, BuiltinActionType.RoomClose, {});
|
|
1984
1984
|
}
|
|
1985
1985
|
catch (e) {
|
|
@@ -2006,10 +2006,10 @@ class Live extends Subscribe {
|
|
|
2006
2006
|
});
|
|
2007
2007
|
// 仅用于用户自己的麦克风控制
|
|
2008
2008
|
this.toggleMicro = (microStatus) => __awaiter(this, void 0, void 0, function* () {
|
|
2009
|
-
var _o, _p
|
|
2010
|
-
if (!((
|
|
2009
|
+
var _m, _o, _p;
|
|
2010
|
+
if (!((_o = (_m = this.selfInfo) === null || _m === void 0 ? void 0 : _m.permission) === null || _o === void 0 ? void 0 : _o.control_own_micro))
|
|
2011
2011
|
return false;
|
|
2012
|
-
const result = yield ((
|
|
2012
|
+
const result = yield ((_p = this.$RTC) === null || _p === void 0 ? void 0 : _p.toggleMicro(microStatus));
|
|
2013
2013
|
if (result) {
|
|
2014
2014
|
yield this.updateStatus(BuiltinEventType.UserChange, BuiltinActionType.UserMicroStatus, {
|
|
2015
2015
|
status: microStatus ? MicroStatus.OPEN : MicroStatus.CLOSE,
|
|
@@ -2024,12 +2024,12 @@ class Live extends Subscribe {
|
|
|
2024
2024
|
* @returns
|
|
2025
2025
|
*/
|
|
2026
2026
|
this.forbidMicro = (microStatus, toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2027
|
-
var
|
|
2027
|
+
var _q, _r;
|
|
2028
2028
|
if (typeof this._options.canForbidUserMicro === 'function' &&
|
|
2029
2029
|
!this._options.canForbidUserMicro(toUserIds)) {
|
|
2030
2030
|
return false;
|
|
2031
2031
|
}
|
|
2032
|
-
if (!((
|
|
2032
|
+
if (!((_r = (_q = this.selfInfo) === null || _q === void 0 ? void 0 : _q.permission) === null || _r === void 0 ? void 0 : _r.control_other_micro)) {
|
|
2033
2033
|
return false;
|
|
2034
2034
|
}
|
|
2035
2035
|
return yield this.updateStatus(BuiltinEventType.UserChange, BuiltinActionType.UserMicroStatus, {
|
|
@@ -2043,12 +2043,12 @@ class Live extends Subscribe {
|
|
|
2043
2043
|
* @returns
|
|
2044
2044
|
*/
|
|
2045
2045
|
this.forbidSync = (sync, toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2046
|
-
var
|
|
2046
|
+
var _s, _t;
|
|
2047
2047
|
if (typeof this._options.canForbidUserSync === 'function' &&
|
|
2048
2048
|
!this._options.canForbidUserSync(toUserIds)) {
|
|
2049
2049
|
return false;
|
|
2050
2050
|
}
|
|
2051
|
-
if (!((
|
|
2051
|
+
if (!((_t = (_s = this.selfInfo) === null || _s === void 0 ? void 0 : _s.permission) === null || _t === void 0 ? void 0 : _t.control_other_sync)) {
|
|
2052
2052
|
return false;
|
|
2053
2053
|
}
|
|
2054
2054
|
return yield this.updateStatus(BuiltinEventType.UserChange, BuiltinActionType.UserPermission, { sync_frame: sync }, toUserIds);
|
|
@@ -2059,12 +2059,12 @@ class Live extends Subscribe {
|
|
|
2059
2059
|
* @returns
|
|
2060
2060
|
*/
|
|
2061
2061
|
this.kick = (toUserIds) => __awaiter(this, void 0, void 0, function* () {
|
|
2062
|
-
var
|
|
2062
|
+
var _u, _v;
|
|
2063
2063
|
if (typeof this._options.canForbidUserKick === 'function' &&
|
|
2064
2064
|
!this._options.canForbidUserKick(toUserIds)) {
|
|
2065
2065
|
return false;
|
|
2066
2066
|
}
|
|
2067
|
-
if (!((
|
|
2067
|
+
if (!((_v = (_u = this.selfInfo) === null || _u === void 0 ? void 0 : _u.permission) === null || _v === void 0 ? void 0 : _v.change_other_status)) {
|
|
2068
2068
|
return false;
|
|
2069
2069
|
}
|
|
2070
2070
|
return yield this.updateStatus(BuiltinEventType.UserChange, BuiltinActionType.UserStatus, {
|