call-live-sdk1 0.0.4 → 0.0.5
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/call-live-sdk.es.js +11 -61
- package/dist/call-live-sdk.umd.js +1 -1
- package/dist/stats-prod.html +1 -1
- package/package.json +1 -1
package/dist/call-live-sdk.es.js
CHANGED
|
@@ -46581,7 +46581,7 @@ const errorConfig = {
|
|
|
46581
46581
|
}
|
|
46582
46582
|
};
|
|
46583
46583
|
const map$d = {
|
|
46584
|
-
production: useSdkStore.getState().getApiDomain(),
|
|
46584
|
+
production: useSdkStore.getState().getApiDomain() || envConfig$1.liveProxyUrl,
|
|
46585
46585
|
test: envConfig$1.liveProxyUrl,
|
|
46586
46586
|
dev: ""
|
|
46587
46587
|
};
|
|
@@ -306040,48 +306040,15 @@ const WebLiveIndex = () => {
|
|
|
306040
306040
|
}, []);
|
|
306041
306041
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserNotSupported, { children: isShowHome ? /* @__PURE__ */ jsxRuntimeExports.jsx(CallHome, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(LiveDetection, { setShowHome }) });
|
|
306042
306042
|
};
|
|
306043
|
-
const validateParam = (config2, paramName, message2) => {
|
|
306044
|
-
if (!config2[paramName]) {
|
|
306045
|
-
window.dispatchEvent(new CustomEvent("paramValidationError", {
|
|
306046
|
-
detail: {
|
|
306047
|
-
message: message2,
|
|
306048
|
-
details: {
|
|
306049
|
-
param: paramName,
|
|
306050
|
-
value: config2[paramName],
|
|
306051
|
-
type: "missing"
|
|
306052
|
-
}
|
|
306053
|
-
}
|
|
306054
|
-
}));
|
|
306055
|
-
return false;
|
|
306056
|
-
}
|
|
306057
|
-
return true;
|
|
306058
|
-
};
|
|
306059
306043
|
class CallLiveSdk {
|
|
306060
306044
|
constructor(config2) {
|
|
306061
306045
|
var _a2;
|
|
306062
306046
|
this.root = null;
|
|
306063
|
-
|
|
306064
|
-
|
|
306065
|
-
|
|
306066
|
-
|
|
306067
|
-
|
|
306068
|
-
details: {
|
|
306069
|
-
param: "config",
|
|
306070
|
-
value: config2,
|
|
306071
|
-
type: "missing"
|
|
306072
|
-
}
|
|
306073
|
-
}
|
|
306074
|
-
}));
|
|
306075
|
-
return;
|
|
306076
|
-
}
|
|
306077
|
-
if (!validateParam(config2, "el", "挂载元素(el)不能为空"))
|
|
306078
|
-
return;
|
|
306079
|
-
if (!validateParam(config2, "liveId", "直播ID(liveId)不能为空"))
|
|
306080
|
-
return;
|
|
306081
|
-
if (!validateParam(config2, "agentId", "商户ID(agentId)不能为空"))
|
|
306082
|
-
return;
|
|
306083
|
-
if (!validateParam(config2, "sign", "签名信息(sign)不能为空"))
|
|
306084
|
-
return;
|
|
306047
|
+
["el", "liveId", "agentId", "sign"].forEach((key) => {
|
|
306048
|
+
if (!config2[key]) {
|
|
306049
|
+
throw new Error(`Missing required config parameter: ${key}`);
|
|
306050
|
+
}
|
|
306051
|
+
});
|
|
306085
306052
|
this.config = config2;
|
|
306086
306053
|
useSdkStore.setState({
|
|
306087
306054
|
callConfig: this.config
|
|
@@ -306095,7 +306062,6 @@ class CallLiveSdk {
|
|
|
306095
306062
|
* 初始化SDK
|
|
306096
306063
|
*/
|
|
306097
306064
|
init() {
|
|
306098
|
-
console.log(this.config);
|
|
306099
306065
|
const {
|
|
306100
306066
|
el: el2
|
|
306101
306067
|
} = this.config || {};
|
|
@@ -306209,27 +306175,11 @@ class GuestCallSdk {
|
|
|
306209
306175
|
constructor(config2) {
|
|
306210
306176
|
var _a2;
|
|
306211
306177
|
this.root = null;
|
|
306212
|
-
|
|
306213
|
-
|
|
306214
|
-
|
|
306215
|
-
|
|
306216
|
-
|
|
306217
|
-
param: "config",
|
|
306218
|
-
value: config2,
|
|
306219
|
-
type: "missing"
|
|
306220
|
-
}
|
|
306221
|
-
}
|
|
306222
|
-
}));
|
|
306223
|
-
return;
|
|
306224
|
-
}
|
|
306225
|
-
if (!validateParam(config2, "el", "挂载元素(el)不能为空"))
|
|
306226
|
-
return;
|
|
306227
|
-
if (!validateParam(config2, "liveId", "直播ID(liveId)不能为空"))
|
|
306228
|
-
return;
|
|
306229
|
-
if (!validateParam(config2, "sign", "签名信息(sign)不能为空"))
|
|
306230
|
-
return;
|
|
306231
|
-
if (!validateParam(config2, "agentId", "商户ID(agentId)不能为空"))
|
|
306232
|
-
return;
|
|
306178
|
+
["el", "liveId", "agentId", "sign"].forEach((key) => {
|
|
306179
|
+
if (!config2[key]) {
|
|
306180
|
+
throw new Error(`Missing required config parameter: ${key}`);
|
|
306181
|
+
}
|
|
306182
|
+
});
|
|
306233
306183
|
this.config = config2;
|
|
306234
306184
|
useSdkStore.setState({
|
|
306235
306185
|
guestConfig: this.config
|