bl-trtc-callkit 1.0.0 → 1.0.1
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/README.md +164 -4
- package/dist/bl-trtc-callkit.css +1 -1
- package/dist/bl-trtc-callkit.js +2 -2
- package/dist/bl-trtc-callkit.umd.cjs +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,7 +1,167 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BlTRTCCallKit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
一个基于 Vue 3 + TypeScript + 腾讯云 TRTC SDK 开发的视频通话组件(无 UI 版),提供完整的音视频通话功能,支持自定义样式和交互。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 功能特性
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- ✅ 视频通话功能
|
|
8
|
+
- ✅ 音频通话功能
|
|
9
|
+
- ✅ 麦克风开关控制
|
|
10
|
+
- ✅ 摄像头开关控制
|
|
11
|
+
- ✅ 网络质量监测与自适应
|
|
12
|
+
- ✅ 远端用户管理
|
|
13
|
+
- ✅ 自定义信令支持
|
|
14
|
+
- ✅ 响应式设计,适配不同屏幕尺寸
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install bl-trtc-callkit
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 快速开始
|
|
23
|
+
|
|
24
|
+
### 基本使用
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<template>
|
|
28
|
+
<BlTRTCCallKit
|
|
29
|
+
ref="callKitRef"
|
|
30
|
+
@notify="onNotify"
|
|
31
|
+
@remote-user-status-change="onRemoteUserStatusChange"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { ref } from 'vue';
|
|
37
|
+
import { BlTRTCCallKit } from 'bl-trtc-callkit';
|
|
38
|
+
import 'bl-trtc-callkit/dist/bl-trtc-callkit.css'; // 导入组件样式
|
|
39
|
+
|
|
40
|
+
const callKitRef = ref(null);
|
|
41
|
+
const localUserId = ref('user_123');
|
|
42
|
+
const targetId = ref('user_456');
|
|
43
|
+
|
|
44
|
+
// 初始化组件
|
|
45
|
+
async function initCallKit() {
|
|
46
|
+
await callKitRef.value.init({
|
|
47
|
+
userId: localUserId.value,
|
|
48
|
+
sdkAppId: "YOUR_SDK_APP_ID",
|
|
49
|
+
sdkSecretKey: "YOUR_SDK_SECRET_KEY",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 发起通话
|
|
54
|
+
async function makeCall() {
|
|
55
|
+
await callKitRef.value.handleCall(targetId.value);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 监听通知
|
|
59
|
+
function onNotify({ type, text }) {
|
|
60
|
+
console.log(`[CallKit] ${type}: ${text}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 监听远端用户状态变化
|
|
64
|
+
function onRemoteUserStatusChange({ userId, action, userList }) {
|
|
65
|
+
console.log(`[CallKit] 用户 ${userId} ${action} 房间,当前房间用户:${userList.join(', ')}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 组件挂载后初始化
|
|
69
|
+
onMounted(() => {
|
|
70
|
+
initCallKit();
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## API 文档
|
|
76
|
+
|
|
77
|
+
### 组件方法
|
|
78
|
+
|
|
79
|
+
| 方法名 | 描述 | 参数 | 返回值 |
|
|
80
|
+
|--------|------|------|--------|
|
|
81
|
+
| `init(options)` | 初始化组件,连接到房间 | `options: { userId?: string, sdkAppId: string, sdkSecretKey: string }` | `Promise<void>` |
|
|
82
|
+
| `show()` | 显示通话界面 | - | `void` |
|
|
83
|
+
| `hide()` | 隐藏通话界面 | - | `void` |
|
|
84
|
+
| `handleCall(targetId)` | 发起呼叫 | `targetId: string` 目标用户ID | `Promise<void>` |
|
|
85
|
+
| `hangup()` | 挂断通话 | - | `Promise<void>` |
|
|
86
|
+
| `acceptCall()` | 接听来电 | - | `Promise<void>` |
|
|
87
|
+
| `rejectCall()` | 拒绝来电 | - | `Promise<void>` |
|
|
88
|
+
| `handleAudioChange()` | 切换麦克风状态 | - | `void` |
|
|
89
|
+
| `handleVideoChange()` | 切换摄像头状态 | - | `void` |
|
|
90
|
+
|
|
91
|
+
### 组件事件
|
|
92
|
+
|
|
93
|
+
| 事件名 | 描述 | 参数 |
|
|
94
|
+
|--------|------|------|
|
|
95
|
+
| `notify` | 通知事件 | `{ type: string, text: string }` 类型:'info' | 'error' | 'warn' |
|
|
96
|
+
| `remote-user-status-change` | 远端用户状态变化 | `{ userId: string, action: 'enter' | 'exit', userList: string[] }` |
|
|
97
|
+
|
|
98
|
+
### 组件属性
|
|
99
|
+
|
|
100
|
+
目前组件不接受属性配置,所有配置通过 `init` 方法传入。
|
|
101
|
+
|
|
102
|
+
## 组件样式
|
|
103
|
+
|
|
104
|
+
组件使用了 CSS 作用域(scoped),确保样式不会污染全局。你可以通过以下方式自定义样式:
|
|
105
|
+
|
|
106
|
+
1. **覆盖默认样式**:
|
|
107
|
+
|
|
108
|
+
```css
|
|
109
|
+
/* 自定义通话界面背景色 */
|
|
110
|
+
.callkit-wrapper {
|
|
111
|
+
background-color: #1a1a1a !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* 自定义控制按钮大小 */
|
|
115
|
+
.callkit-wrapper .operation-btn img {
|
|
116
|
+
width: 56px !important;
|
|
117
|
+
height: 56px !important;
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
2. **使用 CSS 变量**(如果组件支持的话)
|
|
122
|
+
|
|
123
|
+
## 配置选项
|
|
124
|
+
|
|
125
|
+
### 初始化配置
|
|
126
|
+
|
|
127
|
+
| 配置项 | 类型 | 必填 | 默认值 | 描述 |
|
|
128
|
+
|--------|------|------|--------|------|
|
|
129
|
+
| `userId` | `string` | 否 | 随机生成 | 用户ID |
|
|
130
|
+
| `sdkAppId` | `string` | 是 | - | 腾讯云 TRTC 应用 ID |
|
|
131
|
+
| `sdkSecretKey` | `string` | 是 | - | 腾讯云 TRTC 应用密钥 |
|
|
132
|
+
|
|
133
|
+
### 通话配置
|
|
134
|
+
|
|
135
|
+
组件内部使用固定的房间 ID(8888),如果需要自定义房间 ID,可以修改组件代码。
|
|
136
|
+
|
|
137
|
+
## 注意事项
|
|
138
|
+
|
|
139
|
+
1. **权限要求**:
|
|
140
|
+
- 浏览器需要摄像头和麦克风权限
|
|
141
|
+
- HTTPS 环境下才能正常使用音视频功能
|
|
142
|
+
|
|
143
|
+
2. **兼容性**:
|
|
144
|
+
- 支持 Chrome、Firefox、Safari 等现代浏览器
|
|
145
|
+
- 支持 Vue 3.0+ 版本
|
|
146
|
+
- 不支持 Vue 2.x 版本
|
|
147
|
+
|
|
148
|
+
3. **性能优化**:
|
|
149
|
+
- 组件会根据网络质量自动调整视频质量
|
|
150
|
+
- 建议在使用完组件后调用 `hide()` 方法释放资源
|
|
151
|
+
|
|
152
|
+
4. **调试建议**:
|
|
153
|
+
- 开发环境下可以查看浏览器控制台的日志信息
|
|
154
|
+
- 生产环境下建议关闭调试日志
|
|
155
|
+
|
|
156
|
+
## 许可证
|
|
157
|
+
|
|
158
|
+
MIT License
|
|
159
|
+
|
|
160
|
+
## 更新日志
|
|
161
|
+
|
|
162
|
+
### v1.0.0
|
|
163
|
+
- 初始版本
|
|
164
|
+
- 支持基本的音视频通话功能
|
|
165
|
+
- 支持麦克风和摄像头控制
|
|
166
|
+
- 支持网络质量监测
|
|
167
|
+
- 支持自定义信令
|
package/dist/bl-trtc-callkit.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.callkit-wrapper[data-v-
|
|
1
|
+
.callkit-wrapper[data-v-d5ababf3]{width:100%;height:100%;position:fixed;top:0;left:0;z-index:999;background-color:#000c}.callkit-wrapper .bottom-controls[data-v-d5ababf3]{position:fixed;left:0;right:0;bottom:78px;display:flex;justify-content:space-evenly}.callkit-wrapper .operation-btn[data-v-d5ababf3]{display:flex;flex-direction:column;align-items:center;color:#fff;font-size:1rem;cursor:pointer}.callkit-wrapper .operation-btn img[data-v-d5ababf3]{width:64px;height:64px;margin-bottom:12px}.callkit-wrapper .equipment-btn img[data-v-d5ababf3]{border-radius:50%;padding:12px;box-sizing:border-box}.callkit-wrapper .equipment-btn--open img[data-v-d5ababf3]{background:#fff}.callkit-wrapper .equipment-btn--close img[data-v-d5ababf3]{background:#000c}.local-video[data-v-d5ababf3]{position:absolute;top:16px;right:16px;width:120px;height:160px;border-radius:8px;overflow:hidden;background:#000;z-index:1001;box-shadow:0 6px 18px #00000073;transition:transform .18s ease,opacity .18s ease}@media(max-width:600px){.local-video[data-v-d5ababf3]{width:90px;height:120px;top:12px;right:12px}}.player-container[data-v-d5ababf3]{display:grid;width:100%;min-height:100px;gap:10px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));justify-items:center;max-height:100vh;box-sizing:border-box;padding:10px}.player-container .remote[data-v-d5ababf3]{width:auto;max-width:100%;max-height:100%;background:#000;position:relative;border-radius:6px;overflow:hidden;object-fit:contain}.player-container.single[data-v-d5ababf3]{display:flex;align-items:center;justify-content:center;height:100vh;padding:0}.player-container.single .remote[data-v-d5ababf3]{width:auto;max-width:100%;max-height:100%;margin:0}@media(max-width:600px){.player-container[data-v-d5ababf3]{grid-template-columns:repeat(2,1fr)}}.callkit-enter-from[data-v-d5ababf3]{opacity:0;transform:translateY(-20px) scale(.98)}.callkit-enter-active[data-v-d5ababf3]{transition:all .24s ease}.callkit-leave-to[data-v-d5ababf3]{opacity:0;transform:translateY(-20px) scale(.98)}.callkit-leave-active[data-v-d5ababf3]{transition:all .2s ease}.call-label[data-v-d5ababf3]{position:absolute;top:14%;left:0;right:0;text-align:center;color:#fff;font-size:24px;font-weight:600}
|
package/dist/bl-trtc-callkit.js
CHANGED
|
@@ -4179,8 +4179,8 @@ const Vs = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
|
4179
4179
|
_: 1
|
|
4180
4180
|
}));
|
|
4181
4181
|
}
|
|
4182
|
-
}, c0 = /* @__PURE__ */ Gs(s0, [["__scopeId", "data-v-
|
|
4182
|
+
}, c0 = /* @__PURE__ */ Gs(s0, [["__scopeId", "data-v-d5ababf3"]]);
|
|
4183
4183
|
export {
|
|
4184
|
-
c0 as
|
|
4184
|
+
c0 as BlTRTCCallKit,
|
|
4185
4185
|
c0 as default
|
|
4186
4186
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
`,i+="TLS.time:"+n+`
|
|
13
13
|
`,i+="TLS.expire:"+r+`
|
|
14
14
|
`,a!=null&&(i+="TLS.userbuf:"+a+`
|
|
15
|
-
`);let s=Mr.HmacSHA256(i,this.PRIVATEKEY);return Mr.enc.Base64.stringify(s)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return e!==null&&(typeof e=="number"&&!isNaN(e-0)||typeof e=="object"&&e.constructor===Number)}_isString(e){return typeof e=="string"}genSigWithUserbuf(e,n,r){let a=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":a,"TLS.expire":n},s="";if(r!=null){let c=this.base64encode(r);i["TLS.userbuf"]=c,s=this._hmacsha256(e,a,n,c)}else s=this._hmacsha256(e,a,n,null);i["TLS.sig"]=s;let l=JSON.stringify(i),h=va.deflateSync(this.newBuffer(l)).toString("base64"),o=this.escape(h);return console.log("ret="+o),o}validate(e){let n=this.decode(e),r=va.inflateSync(n);console.log("validate ret="+r)}}let xn=window.SDKAppID;console.log("🚀 ~GGG SDKAPPID:",xn);let _r=window.SDKSecretKey;console.log("🚀 ~GGG SECRETKEY:",_r);const _s=604800;function gs({userID:t,SDKAppID:e,SecretKey:n}){e&&(xn=e),n&&(_r=n);const a=new ps(xn,_r,_s).genTestUserSig(t);return{SDKAppID:xn,userSig:a}}const vs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768359133902'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='12117'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M17.516667%20500.983333c0%2055.033333%202.054167%2078.5875%2014.325%20132.345834%204.270833%2018.7%2014.745833%2048.591667%2021.870833%2066.466666%2017.0125%2042.6875%2048.295833%2096.245833%2077.591667%20129.0875%2029.6375%2033.2375%2040.495833%2045.695833%2075.304166%2073.045834%2048.570833%2038.158333%2096.041667%2062.558333%20154.916667%2081.779166%2020.004167%206.525%2052.5%2014.7125%2071.345833%2017%2022.9%202.779167%2040.520833%204.5%2056.5125%205.275h38.279167c16.5-0.783333%2034.504167-2.520833%2058.183333-5.120833%2015.904167-1.75%2033.991667-6.65%2049.720834-10.295833%2023.7125-5.491667%2065.575-21.241667%2086.541666-31.808334%206.816667-3.433333%2012.629167-6.158333%2018.9125-9.429166l19.304167-10.7c28.1-17%2044.783333-30.3125%2069.995833-50.016667l39.791667-38.55c28.733333-34.370833%2043.470833-48.891667%2067.520833-90.825%2011.525-20.0875%2019.495833-37.758333%2028.879167-59.4625%2051.383333-118.845833%2047.283333-280.908333-9.35-393.25-7.1375-14.15-13.129167-25.816667-20.55-39.458333-24.404167-44.895833-71.704167-100.0375-110.358333-131.329167-43.05-34.845833-62.083333-45.495833-111.354167-70.333333-60.920833-30.708333-143.316667-44.433333-212.279167-44.433334-104.808333%200-207.425%2038.2-290.058333%20100-38.145833%2028.533333-76.254167%2068.5875-104.320833%20107.366667C57.291667%20298.758333%2017.516667%20404.133333%2017.516667%20500.983333z'%20fill='%2314B400'%20p-id='12118'%3e%3c/path%3e%3cpath%20d='M401.0875%20150.3875c-90.966667%2016.291667-107.383333%20115.995833-88.566667%20212.3875%2019.2375%2098.554167%2089.308333%20242.670833%20150.279167%20319.683333%2023.741667%2029.991667%2030.2625%2037.158333%2055.091667%2061.583334l20.454166%2019.583333c40.208333%2037.041667%20152.145833%20115.054167%20217.9%2047.6%2010.195833-10.4625%2024.6-30.533333%2027.758334-50.491667%205.091667-32.220833-25.4625-49.9125-46.4375-69.7l-62.375-55.979166c-9.208333-9.379167-12.4875-4.5375-26.516667%200.304166-10.158333%203.5125-19.695833%206.958333-29.591667%2010.408334-41.625%2014.5-32.258333%2017.1125-54.270833-0.316667-61.595833-48.7875-107.7625-105.891667-126.308333-187.154167-2.345833-10.266667-11.1625-59.129167-8.441667-68.341666%202.15-7.279167%2058.345833-50.216667%2059.970833-56.291667%201.4125-5.2875-8.016667-98.666667-8.975-107.670833-2.379167-22.383333-3.391667-49.958333-16.391666-62.0875-14.179167-13.229167-39.808333-17.775-63.579167-13.516667z'%20fill='%23FEFDFC'%20p-id='12119'%3e%3c/path%3e%3c/svg%3e",wa="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768382101596'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8216'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M510.82885015%20513.55777368m358.46705228-358.46705229a506.948967%20506.948967%200%201%200-716.93410456%20716.93410457%20506.948967%20506.948967%200%201%200%20716.93410456-716.93410457Z'%20fill='%23ea331b'%20p-id='8217'%3e%3c/path%3e%3cpath%20d='M511.23865671%20491.7945444c-41.24543107%200-82.50977582%207.84936752-119.82737014%2025.5340869l-7.84306295%2066.7921271c-0.01260984%203.92153148-2.96321511%206.87213675-7.86197665%207.86197664l-112.94262426%2024.55055158c-14.72150427%202.94430142-30.4580674-4.9239805-33.39606355-19.65179004a10.824279%2010.824279%200%200%201-0.01260913-7.85567209l0.99614446-63.84152111c0.97723076-18.66825471%209.82274203-35.35682893%2024.55055087-46.163107%2075.62502924-50.09094233%20165.98417187-77.57949006%20256.34962119-79.55286528%2090.35283807-1.96076538%20179.72844609%2022.60239532%20256.33700994%2071.69719391%2014.72780884%2010.80627807%2023.56701625%2027.50115756%2024.55685614%2046.16941085l-0.98353533%2065.79598264c0%2015.72395329-11.78350812%2027.50746142-27.51376598%2027.51376598-2.93799615%200.97092549-5.88860143%200-7.84936751-0.00630456l-112.96153866-22.58978619c-3.92153077%200-6.86583219-2.94430142-7.85567209-7.85567208l-5.90121055-66.7921271c-37.31128975-15.71134416-77.56057636-22.57087179-117.8413858-21.60625015z%20m0%200'%20fill='%23ffffff'%20p-id='8218'%20data-spm-anchor-id='a313x.search_index.0.i3.5a6e3a81TURsDW'%20class='selected'%3e%3c/path%3e%3c/svg%3e",ws="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358629006'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6156'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20637.1c106.5%200%20193.7-87.2%20193.7-193.7V257.7C705.7%20151.2%20618.5%2064%20512%2064c-106.6%200-193.7%2087.2-193.7%20193.7v185.7c0%20106.5%2087.1%20193.7%20193.7%20193.7z'%20p-id='6157'%20fill='%232c2c2c'%3e%3c/path%3e%3cpath%20d='M834.9%20403c-22.3%200-40.4%2018.1-40.4%2040.4%200%20155.8-126.7%20282.5-282.5%20282.5S229.5%20599.2%20229.5%20443.4c0-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%20183.9%20137.3%20336.1%20314.8%20359.9v108.3c0%2026.6%2021.8%2048.4%2048.4%2048.4%2026.6%200%2048.4-21.8%2048.4-48.4V803.3c177.5-23.8%20314.8-176.1%20314.8-359.9%200.1-22.3-17.9-40.4-40.2-40.4z'%20p-id='6158'%20fill='%232c2c2c'%3e%3c/path%3e%3c/svg%3e",ms="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358648084'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6380'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M556.4%20631.7L318.3%20291.6v151.8c0%20106.6%2087.2%20193.7%20193.7%20193.7%2015.3%200%2030.1-2%2044.4-5.4z'%20p-id='6381'%20fill='%23ffffff'%3e%3c/path%3e%3cpath%20d='M512%20725.9c-155.8%200-282.5-126.7-282.5-282.5%200-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%20183.9%20137.3%20336.1%20314.8%20359.9v108.3c0%2026.6%2021.8%2048.4%2048.4%2048.4%2026.6%200%2048.4-21.8%2048.4-48.4V803.3c34.1-4.6%2066.6-13.9%2097-27.3l-47.6-67.9c-30.4%2011.3-63.3%2017.8-97.7%2017.8zM760.9%20707.3c70.3-66.2%20114.4-160%20114.4-264%200-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%2076.6-30.8%20146.1-80.5%20197l-52.5-74.9c27.4-33.4%2044.2-75.8%2044.2-122.1V257.7C705.7%20151.2%20618.5%2064%20512%2064c-60.8%200-115.1%2028.5-150.7%2072.8l-35.7-51c-10.2-14.5-30.4-18.1-45-7.9-14.5%2010.2-18.1%2030.4-7.9%2045l494.7%20706.6c10.2%2014.5%2030.4%2018.1%2045%207.9%2014.5-10.2%2018.1-30.4%207.9-45l-59.4-85.1z'%20p-id='6382'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",ys="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358681920'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7461'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M868.032%20287.808a64%2064%200%200%201%20101.056%2051.648l2.624%20302.592a64%2064%200%200%201-102.752%2051.456l-206.912-157.536a64%2064%200%200%201%201.728-103.104l204.256-145.056z'%20fill='%232c2c2c'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M144%20192h456.32a96%2096%200%200%201%2096%2096v417.376a96%2096%200%200%201-96%2096H144a96%2096%200%200%201-96-96V288a96%2096%200%200%201%2096-96z'%20fill='%232c2c2c'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",bs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358492097'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4839'%20id='mx_n_1768358492097'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M106.912%20152.096A32%2032%200%201%201%20149.12%20103.904l768%20672a32%2032%200%200%201-42.176%2048.192l-768-672z'%20fill='%23ffffff'%20p-id='4840'%3e%3c/path%3e%3cpath%20d='M732.672%20462.4l-37.056-52.16%20172.416-122.432a64%2064%200%200%201%20101.056%2051.648l2.624%20302.592a63.904%2063.904%200%200%201-20.16%2047.2l-43.84-46.656-2.624-302.592-172.416%20122.432z%20m-34.72-54.016l35.616%2053.184c-10.752%207.2-24.32%2012.16-37.216%2012.16a64%2064%200%200%201-64-64V288a32%2032%200%200%200-32-32h-205.952V192h205.952a96%2096%200%200%201%2096%2096v121.28c0.416-0.224%201.088-0.544%201.6-0.896zM632.32%20608h64v97.376a96%2096%200%200%201-96%2096H144a96%2096%200%200%201-96-96V288a96%2096%200%200%201%2096-96h96v64h-96a32%2032%200%200%200-32%2032v417.376a32%2032%200%200%200%2032%2032h456.32a32%2032%200%200%200%2032-32V608z'%20fill='%23ffffff'%20p-id='4841'%3e%3c/path%3e%3c/svg%3e",ks=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},Es={key:0,class:"callkit-wrapper"},Ss={class:"call-label"},xs=["id"],Rs={class:"bottom-controls"},As={key:0,class:"operation-btn"},Bs=["src"],Ls={class:"operation-btn"},zs=["src"],Ts=["src"],Is={class:"operation-btn"},Ms=["src"],Ds=["src"],ma=ks({__name:"CallKit",emits:["notify","remote-user-status-change"],setup(t,{expose:e,emit:n}){const r=N.ref(""),a=N.ref(null),i=N.ref(null),s=N.ref([]),l=N.ref([]),h=N.reactive({}),o=N.ref(!1),c=N.ref(!1),u=N.ref(""),p=N.ref(""),f=N.ref(null),_=nt.create(),g=n;function d(D,O){try{g("notify",{type:D,text:O})}catch(W){console.warn("emit notify failed",W)}}const v=N.reactive({audio:!0,video:!0}),w=N.ref(!1),m=N.ref("1440p");let y=null;async function x(){if(!a.value||!i.value){d("error","缺少 sdkAppId 或 sdkSecretKey");return}try{const{userSig:D}=gs({userID:r.value,SDKAppID:a.value,SecretKey:i.value});console.log("🚀 ~ 当前用户:",r.value),await _.enterRoom({sdkAppId:a.value,userId:r.value,userSig:D,roomId:8888}),K(),await F(),H(),d("info","进入房间成功")}catch(D){d("error","进入房间失败: "+D)}}async function S({userId:D,sdkAppId:O,sdkSecretKey:W}={}){r.value=D||`user_${Math.floor(Math.random()*900+100)}`,a.value=O||a.value,i.value=W||i.value,await x()}function k(){o.value=!0}function E(){o.value=!1,c.value=!1,f.value=null,u.value="",p.value=""}async function B(){try{await _.exitRoom(),console.log("🚀 ~ 退出房间成功"),await R(),await j(),it(),Z()}catch(D){d("error","退出房间失败: "+D)}}async function b(){console.log("🚀 ~ 打开麦克风");try{await _.startLocalAudio(),v.audio=!0}catch(D){v.audio=!1,d("error","启动麦克风失败: "+D)}}async function R(){console.log("🚀 ~ 关闭麦克风"),await _.stopLocalAudio();try{await _.stopLocalAudio(),v.audio=!1}catch(D){d("error","关闭麦克风失败: "+D)}}async function C(){console.log("🚀 ~ 打开摄像头");try{const D="local-video",O=await nt.getCameraList();await _.startLocalVideo({view:D,option:{profile:m.value}}),O[1]&&await _.updateLocalVideo({option:{cameraId:O[1].deviceId}}),v.video=!0}catch(D){v.video=!1,d("error","打开摄像头失败: "+D)}}async function L(D){if(!(!D||m.value===D))try{try{await _.stopLocalVideo()}catch{}await _.startLocalVideo({view:"local-video",option:{profile:D}}),m.value=D,v.video=!0,d("info",`已将视频质量调整为 ${D}`)}catch(O){v.video=!1,d("error","调整视频质量失败:"+O)}}async function P(){try{let D=null;typeof _.getLocalStats=="function"&&(D=await _.getLocalStats());let O=!1,W="";if(D){const Y=D.uplinkKbps??D.sendKbps??D.txKbps??null,V=D.uplinkPacketLostRate??D.packetLostRate??D.sendPacketLostRate??null;W=`uplink:${Y??"n/a"}kbps loss:${V??"n/a"}`,(Y!==null&&Y<300||V!==null&&V>.05)&&(O=!0)}else if(typeof _.getNetworkQuality=="function"){const Y=await _.getNetworkQuality(),V=Y.uplinkQuality??Y.upQuality??null;W=`uplinkQuality:${V??"n/a"}`,V!==null&&V>=4&&(O=!0)}else return;O&&!w.value?(w.value=!0,d("warn",`网络不稳定:${W},已切换到低清 360p`),await L("360p")):!O&&w.value&&(w.value=!1,d("info",`网络已恢复:${W},恢复到高清`),await L("1440p"))}catch(D){console.warn("checkNetworkQuality error",D)}}function H(){Z(),y=setInterval(()=>{P()},5e3)}function Z(){y&&(clearInterval(y),y=null)}async function j(){console.log("🚀 ~ 关闭摄像头");try{await _.stopLocalVideo(),v.video=!1}catch(D){d("error","关闭摄像头失败: "+D)}}async function F(){console.log("🚀 ~ 打开扬声器");try{await _.setCurrentSpeaker(nt.TYPE.SPEAKER)}catch(D){d("error","打开扬声器失败:"+D)}}function K(){_.on(nt.EVENT.ERROR,T),_.on(nt.EVENT.REMOTE_VIDEO_AVAILABLE,z),_.on(nt.EVENT.REMOTE_VIDEO_UNAVAILABLE,I),_.on(nt.EVENT.VIDEO_SIZE_CHANGED,M),_.on(nt.EVENT.REMOTE_AUDIO_AVAILABLE,at),_.on(nt.EVENT.REMOTE_USER_ENTER,wt),_.on(nt.EVENT.REMOTE_USER_EXIT,gt),_.on(nt.EVENT.CUSTOM_MESSAGE,Ut)}function it(){_.off(nt.EVENT.ERROR,T),_.off(nt.EVENT.REMOTE_VIDEO_AVAILABLE,z),_.off(nt.EVENT.REMOTE_VIDEO_UNAVAILABLE,I),_.off(nt.EVENT.VIDEO_SIZE_CHANGED,M),_.off(nt.EVENT.REMOTE_AUDIO_AVAILABLE,at),_.off(nt.EVENT.REMOTE_USER_ENTER,wt),_.off(nt.EVENT.REMOTE_USER_EXIT,gt),_.off(nt.EVENT.CUSTOM_MESSAGE,Ut)}function T(D){console.error("🚀 ~ 错误 ~ error:",D),d("error","TRTC 错误:"+(D&&D.message?D.message:JSON.stringify(D)))}function M(D){console.log("🚀 ~ 远端视频尺寸变化 ~ event:",D);const{userId:O,streamType:W,newHeight:Y,newWidth:V}=D,ut=`${O}_${W}`;Y>0&&V>0&&(h[ut]=V/Y)}async function z(D){console.log("🚀 ~ 远端用户发布了视频 ~ event:",D);const{userId:O,streamType:W}=D,Y=`${O}_${W}`;try{if(W===nt.TYPE.STREAM_TYPE_MAIN){s.value.push(Y),await N.nextTick(),await _.startRemoteVideo({userId:O,streamType:W,view:Y});try{await _.startRemoteAudio({userId:O})}catch{}await F()}else{s.value.push(Y),await N.nextTick(),_.startRemoteVideo({userId:O,streamType:W,view:Y});try{await _.startRemoteAudio({userId:O})}catch{}}setTimeout(()=>{try{const V=document.getElementById(Y);if(V){const ut=V.querySelector("video");ut&&ut.videoWidth>0&&ut.videoHeight>0&&(h[Y]=ut.videoWidth/ut.videoHeight)}}catch(V){console.warn("Failed to get video element:",V)}},1e3)}catch(V){console.log("🚀 ~ handleRemoteVideoAvailable ~ error:",V),d("error","远端视频订阅失败:"+V)}}async function I(D){console.log("🚀 ~ 远端用户停止发布视频 ~ event:",D);const{userId:O,streamType:W}=D,Y=`${O}_${W}`;try{await _.stopRemoteVideo({userId:O,streamType:W})}catch{}const V=s.value.indexOf(Y);V!==-1&&s.value.splice(V,1),delete h[Y]}async function at(D){console.log("🚀 ~ 异步订阅音频 ~ event:",D);const{userId:O}=D;try{await _.startRemoteAudio({userId:O})}catch(W){console.warn("startRemoteAudio fail",W)}}function wt(D){const{userId:O}=D;if(console.log("🚀 ~ 远端用户进入/退出",O),!l.value.includes(O)){l.value.push(O),d("info",`用户 ${O} 进入房间`);try{g("remote-user-status-change",{userId:O,action:"enter",userList:[...l.value]})}catch(W){console.warn("emit remote-user-status-change failed",W)}}}async function gt(D){const{userId:O}=D;console.log("🚀 ~ 远端用户退出房间",O);try{await _.stopRemoteAudio({userId:O})}catch{}try{await _.stopRemoteVideo({userId:O,streamType:nt.TYPE.STREAM_TYPE_MAIN})}catch{}try{await _.stopRemoteVideo({userId:O,streamType:nt.TYPE.STREAM_TYPE_SUB})}catch{}["main","screen","sub"].forEach(Y=>{const V=`${O}_${Y}`,ut=s.value.indexOf(V);ut!==-1&&s.value.splice(ut,1),delete h[V]});const W=l.value.indexOf(O);W!==-1&&l.value.splice(W,1),d("info",`用户 ${O} 离开房间`);try{g("remote-user-status-change",{userId:O,action:"exit",userList:[...l.value]})}catch(Y){console.warn("emit remote-user-status-change failed",Y)}try{const Y=l.value.length;c.value&&Y===0&&u.value===O&&(d("info","对方已离开,正在自动结束本地通话"),await Rt())}catch(Y){console.warn("auto hangup on remote exit failed",Y)}}async function St(D,O=1){console.log("🚀 ~ 发送自定义信令(广播) ~ payload, cmdId:",D,O);try{const Y=new TextEncoder().encode(JSON.stringify(D)).buffer;await _.sendCustomMessage({cmdId:O,data:Y})}catch(W){console.warn("发送自定义信令(广播)",W),d("error","发送信令失败:"+W)}}async function Ut(D){console.log("🚀 ~ 收到自定义消息",D);let O=null;if(D.data instanceof ArrayBuffer?(O=D.data,D.userId||D.from):D.message&&D.message.data?(O=D.message.data,D.userId||D.message.userId):(D.userId&&D.cmdId&&D.data||D.userId&&D.data instanceof ArrayBuffer)&&(O=D.data,D.userId),!!O)try{const Y=new TextDecoder().decode(new Uint8Array(O)),V=JSON.parse(Y);if(console.log("🚀 ~ 收到自定义消息内容",V),!V||!V.type)return;V.type==="incoming_call"&&V.to===r.value?(f.value={from:V.from,callId:V.callId},o.value=!0,p.value=V.from):V.type==="call_response"&&V.to===r.value?V.accept?(d("info",`用户 ${V.from} 接听了呼叫`),await b(),await C(),c.value=!0,p.value=V.from):(d("info",`用户 ${V.from} 拒绝了呼叫`),E()):V.type==="hangup_call"&&V.to===r.value&&(await Rt(),d("info",`用户 ${V.from} 已挂断通话`))}catch(W){console.warn("parse custom message fail",W),d("error","接收广播消息异常: "+error.message)}}async function qe(D){console.log("🚀 ~ 发起呼叫");const O=D&&String(D).trim();if(!O){d("error","缺少呼叫目标,请传入目标用户ID");return}if(!l.value.includes(O)){d("error","用户不在线或未加入房间");return}o.value=!0,u.value=O,p.value=O;const W=`call_${Date.now()}_${Math.floor(Math.random()*1e4)}`,Y={type:"incoming_call",from:r.value,to:O,callId:W};await St(Y,1),d("info",`已向 ${O} 发起呼叫,等待应答`)}async function Rt(){try{await R(),await j();const D=`call_${Date.now()}_${Math.floor(Math.random()*1e4)}`,O={type:"hangup_call",from:r.value,to:u.value,callId:D};await St(O,3),E(),d("info","已挂断")}catch(D){console.warn("hangup fail",D),d("error","挂断失败:"+D)}}async function mt(){if(console.log("🚀 ~ 接听来电"),!f.value)return;const D={type:"call_response",from:r.value,to:f.value.from,callId:f.value.callId,accept:!0};await St(D,2),await b(),await C(),c.value=!0,u.value=f.value.from,p.value=f.value.from,f.value=null}async function vt(){if(console.log("🚀 ~ 拒绝来电"),f.value){const D={type:"call_response",from:r.value,to:f.value.from,callId:f.value.callId,accept:!1};await St(D,2),f.value=null,E();return}else Rt()}function Ae(){v.audio?R():b()}function ge(){v.video?j():C()}return e({handleCall:qe,init:S,show:k,hide:E,hangup:Rt}),N.onUnmounted(()=>{B()}),(D,O)=>(N.openBlock(),N.createBlock(N.Transition,{name:"callkit"},{default:N.withCtx(()=>[o.value?(N.openBlock(),N.createElementBlock("div",Es,[N.createElementVNode("div",Ss,N.toDisplayString(p.value),1),O[3]||(O[3]=N.createElementVNode("div",{class:"local-video",id:"local-video"},null,-1)),N.createElementVNode("div",{class:N.normalizeClass(["player-container",{single:s.value.length===1}])},[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(s.value,W=>(N.openBlock(),N.createElementBlock("div",{key:W,class:"remote",id:W,style:N.normalizeStyle({aspectRatio:h[W]||"16/9"})},null,12,xs))),128))],2),N.createElementVNode("div",Rs,[c.value?(N.openBlock(),N.createElementBlock(N.Fragment,{key:1},[N.createElementVNode("div",{class:N.normalizeClass(["equipment-btn operation-btn",v.audio?"equipment-btn--open":"equipment-btn--close"])},[N.createElementVNode("img",{src:v.audio?N.unref(ws):N.unref(ms),onClick:Ae},null,8,Ts),N.createElementVNode("div",null,N.toDisplayString(v.audio?"麦克风已开":"麦克风已关"),1)],2),N.createElementVNode("div",Is,[N.createElementVNode("img",{src:N.unref(wa),onClick:Rt},null,8,Ms),O[2]||(O[2]=N.createElementVNode("div",null,"挂断",-1))]),N.createElementVNode("div",{class:N.normalizeClass(["equipment-btn operation-btn",v.video?"equipment-btn--open":"equipment-btn--close"])},[N.createElementVNode("img",{src:v.video?N.unref(ys):N.unref(bs),onClick:ge},null,8,Ds),N.createElementVNode("div",null,N.toDisplayString(v.video?"摄像头已开":"摄像头已关"),1)],2)],64)):(N.openBlock(),N.createElementBlock(N.Fragment,{key:0},[f.value?(N.openBlock(),N.createElementBlock("div",As,[N.createElementVNode("img",{src:N.unref(vs),onClick:mt},null,8,Bs),O[0]||(O[0]=N.createElementVNode("div",null,"接听",-1))])):N.createCommentVNode("",!0),N.createElementVNode("div",Ls,[N.createElementVNode("img",{src:N.unref(wa),onClick:vt},null,8,zs),O[1]||(O[1]=N.createElementVNode("div",null,"挂断",-1))])],64))])])):N.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-7a5bd531"]]);It.CallKit=ma,It.default=ma,Object.defineProperties(It,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
15
|
+
`);let s=Mr.HmacSHA256(i,this.PRIVATEKEY);return Mr.enc.Base64.stringify(s)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return e!==null&&(typeof e=="number"&&!isNaN(e-0)||typeof e=="object"&&e.constructor===Number)}_isString(e){return typeof e=="string"}genSigWithUserbuf(e,n,r){let a=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":a,"TLS.expire":n},s="";if(r!=null){let c=this.base64encode(r);i["TLS.userbuf"]=c,s=this._hmacsha256(e,a,n,c)}else s=this._hmacsha256(e,a,n,null);i["TLS.sig"]=s;let l=JSON.stringify(i),h=va.deflateSync(this.newBuffer(l)).toString("base64"),o=this.escape(h);return console.log("ret="+o),o}validate(e){let n=this.decode(e),r=va.inflateSync(n);console.log("validate ret="+r)}}let xn=window.SDKAppID;console.log("🚀 ~GGG SDKAPPID:",xn);let _r=window.SDKSecretKey;console.log("🚀 ~GGG SECRETKEY:",_r);const _s=604800;function gs({userID:t,SDKAppID:e,SecretKey:n}){e&&(xn=e),n&&(_r=n);const a=new ps(xn,_r,_s).genTestUserSig(t);return{SDKAppID:xn,userSig:a}}const vs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768359133902'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='12117'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M17.516667%20500.983333c0%2055.033333%202.054167%2078.5875%2014.325%20132.345834%204.270833%2018.7%2014.745833%2048.591667%2021.870833%2066.466666%2017.0125%2042.6875%2048.295833%2096.245833%2077.591667%20129.0875%2029.6375%2033.2375%2040.495833%2045.695833%2075.304166%2073.045834%2048.570833%2038.158333%2096.041667%2062.558333%20154.916667%2081.779166%2020.004167%206.525%2052.5%2014.7125%2071.345833%2017%2022.9%202.779167%2040.520833%204.5%2056.5125%205.275h38.279167c16.5-0.783333%2034.504167-2.520833%2058.183333-5.120833%2015.904167-1.75%2033.991667-6.65%2049.720834-10.295833%2023.7125-5.491667%2065.575-21.241667%2086.541666-31.808334%206.816667-3.433333%2012.629167-6.158333%2018.9125-9.429166l19.304167-10.7c28.1-17%2044.783333-30.3125%2069.995833-50.016667l39.791667-38.55c28.733333-34.370833%2043.470833-48.891667%2067.520833-90.825%2011.525-20.0875%2019.495833-37.758333%2028.879167-59.4625%2051.383333-118.845833%2047.283333-280.908333-9.35-393.25-7.1375-14.15-13.129167-25.816667-20.55-39.458333-24.404167-44.895833-71.704167-100.0375-110.358333-131.329167-43.05-34.845833-62.083333-45.495833-111.354167-70.333333-60.920833-30.708333-143.316667-44.433333-212.279167-44.433334-104.808333%200-207.425%2038.2-290.058333%20100-38.145833%2028.533333-76.254167%2068.5875-104.320833%20107.366667C57.291667%20298.758333%2017.516667%20404.133333%2017.516667%20500.983333z'%20fill='%2314B400'%20p-id='12118'%3e%3c/path%3e%3cpath%20d='M401.0875%20150.3875c-90.966667%2016.291667-107.383333%20115.995833-88.566667%20212.3875%2019.2375%2098.554167%2089.308333%20242.670833%20150.279167%20319.683333%2023.741667%2029.991667%2030.2625%2037.158333%2055.091667%2061.583334l20.454166%2019.583333c40.208333%2037.041667%20152.145833%20115.054167%20217.9%2047.6%2010.195833-10.4625%2024.6-30.533333%2027.758334-50.491667%205.091667-32.220833-25.4625-49.9125-46.4375-69.7l-62.375-55.979166c-9.208333-9.379167-12.4875-4.5375-26.516667%200.304166-10.158333%203.5125-19.695833%206.958333-29.591667%2010.408334-41.625%2014.5-32.258333%2017.1125-54.270833-0.316667-61.595833-48.7875-107.7625-105.891667-126.308333-187.154167-2.345833-10.266667-11.1625-59.129167-8.441667-68.341666%202.15-7.279167%2058.345833-50.216667%2059.970833-56.291667%201.4125-5.2875-8.016667-98.666667-8.975-107.670833-2.379167-22.383333-3.391667-49.958333-16.391666-62.0875-14.179167-13.229167-39.808333-17.775-63.579167-13.516667z'%20fill='%23FEFDFC'%20p-id='12119'%3e%3c/path%3e%3c/svg%3e",wa="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768382101596'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8216'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M510.82885015%20513.55777368m358.46705228-358.46705229a506.948967%20506.948967%200%201%200-716.93410456%20716.93410457%20506.948967%20506.948967%200%201%200%20716.93410456-716.93410457Z'%20fill='%23ea331b'%20p-id='8217'%3e%3c/path%3e%3cpath%20d='M511.23865671%20491.7945444c-41.24543107%200-82.50977582%207.84936752-119.82737014%2025.5340869l-7.84306295%2066.7921271c-0.01260984%203.92153148-2.96321511%206.87213675-7.86197665%207.86197664l-112.94262426%2024.55055158c-14.72150427%202.94430142-30.4580674-4.9239805-33.39606355-19.65179004a10.824279%2010.824279%200%200%201-0.01260913-7.85567209l0.99614446-63.84152111c0.97723076-18.66825471%209.82274203-35.35682893%2024.55055087-46.163107%2075.62502924-50.09094233%20165.98417187-77.57949006%20256.34962119-79.55286528%2090.35283807-1.96076538%20179.72844609%2022.60239532%20256.33700994%2071.69719391%2014.72780884%2010.80627807%2023.56701625%2027.50115756%2024.55685614%2046.16941085l-0.98353533%2065.79598264c0%2015.72395329-11.78350812%2027.50746142-27.51376598%2027.51376598-2.93799615%200.97092549-5.88860143%200-7.84936751-0.00630456l-112.96153866-22.58978619c-3.92153077%200-6.86583219-2.94430142-7.85567209-7.85567208l-5.90121055-66.7921271c-37.31128975-15.71134416-77.56057636-22.57087179-117.8413858-21.60625015z%20m0%200'%20fill='%23ffffff'%20p-id='8218'%20data-spm-anchor-id='a313x.search_index.0.i3.5a6e3a81TURsDW'%20class='selected'%3e%3c/path%3e%3c/svg%3e",ws="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358629006'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6156'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M512%20637.1c106.5%200%20193.7-87.2%20193.7-193.7V257.7C705.7%20151.2%20618.5%2064%20512%2064c-106.6%200-193.7%2087.2-193.7%20193.7v185.7c0%20106.5%2087.1%20193.7%20193.7%20193.7z'%20p-id='6157'%20fill='%232c2c2c'%3e%3c/path%3e%3cpath%20d='M834.9%20403c-22.3%200-40.4%2018.1-40.4%2040.4%200%20155.8-126.7%20282.5-282.5%20282.5S229.5%20599.2%20229.5%20443.4c0-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%20183.9%20137.3%20336.1%20314.8%20359.9v108.3c0%2026.6%2021.8%2048.4%2048.4%2048.4%2026.6%200%2048.4-21.8%2048.4-48.4V803.3c177.5-23.8%20314.8-176.1%20314.8-359.9%200.1-22.3-17.9-40.4-40.2-40.4z'%20p-id='6158'%20fill='%232c2c2c'%3e%3c/path%3e%3c/svg%3e",ms="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358648084'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6380'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M556.4%20631.7L318.3%20291.6v151.8c0%20106.6%2087.2%20193.7%20193.7%20193.7%2015.3%200%2030.1-2%2044.4-5.4z'%20p-id='6381'%20fill='%23ffffff'%3e%3c/path%3e%3cpath%20d='M512%20725.9c-155.8%200-282.5-126.7-282.5-282.5%200-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%20183.9%20137.3%20336.1%20314.8%20359.9v108.3c0%2026.6%2021.8%2048.4%2048.4%2048.4%2026.6%200%2048.4-21.8%2048.4-48.4V803.3c34.1-4.6%2066.6-13.9%2097-27.3l-47.6-67.9c-30.4%2011.3-63.3%2017.8-97.7%2017.8zM760.9%20707.3c70.3-66.2%20114.4-160%20114.4-264%200-22.3-18.1-40.4-40.4-40.4s-40.4%2018.1-40.4%2040.4c0%2076.6-30.8%20146.1-80.5%20197l-52.5-74.9c27.4-33.4%2044.2-75.8%2044.2-122.1V257.7C705.7%20151.2%20618.5%2064%20512%2064c-60.8%200-115.1%2028.5-150.7%2072.8l-35.7-51c-10.2-14.5-30.4-18.1-45-7.9-14.5%2010.2-18.1%2030.4-7.9%2045l494.7%20706.6c10.2%2014.5%2030.4%2018.1%2045%207.9%2014.5-10.2%2018.1-30.4%207.9-45l-59.4-85.1z'%20p-id='6382'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",ys="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358681920'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7461'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M868.032%20287.808a64%2064%200%200%201%20101.056%2051.648l2.624%20302.592a64%2064%200%200%201-102.752%2051.456l-206.912-157.536a64%2064%200%200%201%201.728-103.104l204.256-145.056z'%20fill='%232c2c2c'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M144%20192h456.32a96%2096%200%200%201%2096%2096v417.376a96%2096%200%200%201-96%2096H144a96%2096%200%200%201-96-96V288a96%2096%200%200%201%2096-96z'%20fill='%232c2c2c'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",bs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1768358492097'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4839'%20id='mx_n_1768358492097'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M106.912%20152.096A32%2032%200%201%201%20149.12%20103.904l768%20672a32%2032%200%200%201-42.176%2048.192l-768-672z'%20fill='%23ffffff'%20p-id='4840'%3e%3c/path%3e%3cpath%20d='M732.672%20462.4l-37.056-52.16%20172.416-122.432a64%2064%200%200%201%20101.056%2051.648l2.624%20302.592a63.904%2063.904%200%200%201-20.16%2047.2l-43.84-46.656-2.624-302.592-172.416%20122.432z%20m-34.72-54.016l35.616%2053.184c-10.752%207.2-24.32%2012.16-37.216%2012.16a64%2064%200%200%201-64-64V288a32%2032%200%200%200-32-32h-205.952V192h205.952a96%2096%200%200%201%2096%2096v121.28c0.416-0.224%201.088-0.544%201.6-0.896zM632.32%20608h64v97.376a96%2096%200%200%201-96%2096H144a96%2096%200%200%201-96-96V288a96%2096%200%200%201%2096-96h96v64h-96a32%2032%200%200%200-32%2032v417.376a32%2032%200%200%200%2032%2032h456.32a32%2032%200%200%200%2032-32V608z'%20fill='%23ffffff'%20p-id='4841'%3e%3c/path%3e%3c/svg%3e",ks=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},Es={key:0,class:"callkit-wrapper"},Ss={class:"call-label"},xs=["id"],Rs={class:"bottom-controls"},As={key:0,class:"operation-btn"},Bs=["src"],Ls={class:"operation-btn"},zs=["src"],Ts=["src"],Is={class:"operation-btn"},Ms=["src"],Ds=["src"],ma=ks({__name:"CallKit",emits:["notify","remote-user-status-change"],setup(t,{expose:e,emit:n}){const r=N.ref(""),a=N.ref(null),i=N.ref(null),s=N.ref([]),l=N.ref([]),h=N.reactive({}),o=N.ref(!1),c=N.ref(!1),u=N.ref(""),p=N.ref(""),f=N.ref(null),_=nt.create(),g=n;function d(D,O){try{g("notify",{type:D,text:O})}catch(W){console.warn("emit notify failed",W)}}const v=N.reactive({audio:!0,video:!0}),w=N.ref(!1),m=N.ref("1440p");let y=null;async function x(){if(!a.value||!i.value){d("error","缺少 sdkAppId 或 sdkSecretKey");return}try{const{userSig:D}=gs({userID:r.value,SDKAppID:a.value,SecretKey:i.value});console.log("🚀 ~ 当前用户:",r.value),await _.enterRoom({sdkAppId:a.value,userId:r.value,userSig:D,roomId:8888}),K(),await F(),H(),d("info","进入房间成功")}catch(D){d("error","进入房间失败: "+D)}}async function S({userId:D,sdkAppId:O,sdkSecretKey:W}={}){r.value=D||`user_${Math.floor(Math.random()*900+100)}`,a.value=O||a.value,i.value=W||i.value,await x()}function k(){o.value=!0}function E(){o.value=!1,c.value=!1,f.value=null,u.value="",p.value=""}async function B(){try{await _.exitRoom(),console.log("🚀 ~ 退出房间成功"),await R(),await j(),it(),Z()}catch(D){d("error","退出房间失败: "+D)}}async function b(){console.log("🚀 ~ 打开麦克风");try{await _.startLocalAudio(),v.audio=!0}catch(D){v.audio=!1,d("error","启动麦克风失败: "+D)}}async function R(){console.log("🚀 ~ 关闭麦克风"),await _.stopLocalAudio();try{await _.stopLocalAudio(),v.audio=!1}catch(D){d("error","关闭麦克风失败: "+D)}}async function C(){console.log("🚀 ~ 打开摄像头");try{const D="local-video",O=await nt.getCameraList();await _.startLocalVideo({view:D,option:{profile:m.value}}),O[1]&&await _.updateLocalVideo({option:{cameraId:O[1].deviceId}}),v.video=!0}catch(D){v.video=!1,d("error","打开摄像头失败: "+D)}}async function L(D){if(!(!D||m.value===D))try{try{await _.stopLocalVideo()}catch{}await _.startLocalVideo({view:"local-video",option:{profile:D}}),m.value=D,v.video=!0,d("info",`已将视频质量调整为 ${D}`)}catch(O){v.video=!1,d("error","调整视频质量失败:"+O)}}async function P(){try{let D=null;typeof _.getLocalStats=="function"&&(D=await _.getLocalStats());let O=!1,W="";if(D){const Y=D.uplinkKbps??D.sendKbps??D.txKbps??null,V=D.uplinkPacketLostRate??D.packetLostRate??D.sendPacketLostRate??null;W=`uplink:${Y??"n/a"}kbps loss:${V??"n/a"}`,(Y!==null&&Y<300||V!==null&&V>.05)&&(O=!0)}else if(typeof _.getNetworkQuality=="function"){const Y=await _.getNetworkQuality(),V=Y.uplinkQuality??Y.upQuality??null;W=`uplinkQuality:${V??"n/a"}`,V!==null&&V>=4&&(O=!0)}else return;O&&!w.value?(w.value=!0,d("warn",`网络不稳定:${W},已切换到低清 360p`),await L("360p")):!O&&w.value&&(w.value=!1,d("info",`网络已恢复:${W},恢复到高清`),await L("1440p"))}catch(D){console.warn("checkNetworkQuality error",D)}}function H(){Z(),y=setInterval(()=>{P()},5e3)}function Z(){y&&(clearInterval(y),y=null)}async function j(){console.log("🚀 ~ 关闭摄像头");try{await _.stopLocalVideo(),v.video=!1}catch(D){d("error","关闭摄像头失败: "+D)}}async function F(){console.log("🚀 ~ 打开扬声器");try{await _.setCurrentSpeaker(nt.TYPE.SPEAKER)}catch(D){d("error","打开扬声器失败:"+D)}}function K(){_.on(nt.EVENT.ERROR,T),_.on(nt.EVENT.REMOTE_VIDEO_AVAILABLE,z),_.on(nt.EVENT.REMOTE_VIDEO_UNAVAILABLE,I),_.on(nt.EVENT.VIDEO_SIZE_CHANGED,M),_.on(nt.EVENT.REMOTE_AUDIO_AVAILABLE,at),_.on(nt.EVENT.REMOTE_USER_ENTER,wt),_.on(nt.EVENT.REMOTE_USER_EXIT,gt),_.on(nt.EVENT.CUSTOM_MESSAGE,Ut)}function it(){_.off(nt.EVENT.ERROR,T),_.off(nt.EVENT.REMOTE_VIDEO_AVAILABLE,z),_.off(nt.EVENT.REMOTE_VIDEO_UNAVAILABLE,I),_.off(nt.EVENT.VIDEO_SIZE_CHANGED,M),_.off(nt.EVENT.REMOTE_AUDIO_AVAILABLE,at),_.off(nt.EVENT.REMOTE_USER_ENTER,wt),_.off(nt.EVENT.REMOTE_USER_EXIT,gt),_.off(nt.EVENT.CUSTOM_MESSAGE,Ut)}function T(D){console.error("🚀 ~ 错误 ~ error:",D),d("error","TRTC 错误:"+(D&&D.message?D.message:JSON.stringify(D)))}function M(D){console.log("🚀 ~ 远端视频尺寸变化 ~ event:",D);const{userId:O,streamType:W,newHeight:Y,newWidth:V}=D,ut=`${O}_${W}`;Y>0&&V>0&&(h[ut]=V/Y)}async function z(D){console.log("🚀 ~ 远端用户发布了视频 ~ event:",D);const{userId:O,streamType:W}=D,Y=`${O}_${W}`;try{if(W===nt.TYPE.STREAM_TYPE_MAIN){s.value.push(Y),await N.nextTick(),await _.startRemoteVideo({userId:O,streamType:W,view:Y});try{await _.startRemoteAudio({userId:O})}catch{}await F()}else{s.value.push(Y),await N.nextTick(),_.startRemoteVideo({userId:O,streamType:W,view:Y});try{await _.startRemoteAudio({userId:O})}catch{}}setTimeout(()=>{try{const V=document.getElementById(Y);if(V){const ut=V.querySelector("video");ut&&ut.videoWidth>0&&ut.videoHeight>0&&(h[Y]=ut.videoWidth/ut.videoHeight)}}catch(V){console.warn("Failed to get video element:",V)}},1e3)}catch(V){console.log("🚀 ~ handleRemoteVideoAvailable ~ error:",V),d("error","远端视频订阅失败:"+V)}}async function I(D){console.log("🚀 ~ 远端用户停止发布视频 ~ event:",D);const{userId:O,streamType:W}=D,Y=`${O}_${W}`;try{await _.stopRemoteVideo({userId:O,streamType:W})}catch{}const V=s.value.indexOf(Y);V!==-1&&s.value.splice(V,1),delete h[Y]}async function at(D){console.log("🚀 ~ 异步订阅音频 ~ event:",D);const{userId:O}=D;try{await _.startRemoteAudio({userId:O})}catch(W){console.warn("startRemoteAudio fail",W)}}function wt(D){const{userId:O}=D;if(console.log("🚀 ~ 远端用户进入/退出",O),!l.value.includes(O)){l.value.push(O),d("info",`用户 ${O} 进入房间`);try{g("remote-user-status-change",{userId:O,action:"enter",userList:[...l.value]})}catch(W){console.warn("emit remote-user-status-change failed",W)}}}async function gt(D){const{userId:O}=D;console.log("🚀 ~ 远端用户退出房间",O);try{await _.stopRemoteAudio({userId:O})}catch{}try{await _.stopRemoteVideo({userId:O,streamType:nt.TYPE.STREAM_TYPE_MAIN})}catch{}try{await _.stopRemoteVideo({userId:O,streamType:nt.TYPE.STREAM_TYPE_SUB})}catch{}["main","screen","sub"].forEach(Y=>{const V=`${O}_${Y}`,ut=s.value.indexOf(V);ut!==-1&&s.value.splice(ut,1),delete h[V]});const W=l.value.indexOf(O);W!==-1&&l.value.splice(W,1),d("info",`用户 ${O} 离开房间`);try{g("remote-user-status-change",{userId:O,action:"exit",userList:[...l.value]})}catch(Y){console.warn("emit remote-user-status-change failed",Y)}try{const Y=l.value.length;c.value&&Y===0&&u.value===O&&(d("info","对方已离开,正在自动结束本地通话"),await Rt())}catch(Y){console.warn("auto hangup on remote exit failed",Y)}}async function St(D,O=1){console.log("🚀 ~ 发送自定义信令(广播) ~ payload, cmdId:",D,O);try{const Y=new TextEncoder().encode(JSON.stringify(D)).buffer;await _.sendCustomMessage({cmdId:O,data:Y})}catch(W){console.warn("发送自定义信令(广播)",W),d("error","发送信令失败:"+W)}}async function Ut(D){console.log("🚀 ~ 收到自定义消息",D);let O=null;if(D.data instanceof ArrayBuffer?(O=D.data,D.userId||D.from):D.message&&D.message.data?(O=D.message.data,D.userId||D.message.userId):(D.userId&&D.cmdId&&D.data||D.userId&&D.data instanceof ArrayBuffer)&&(O=D.data,D.userId),!!O)try{const Y=new TextDecoder().decode(new Uint8Array(O)),V=JSON.parse(Y);if(console.log("🚀 ~ 收到自定义消息内容",V),!V||!V.type)return;V.type==="incoming_call"&&V.to===r.value?(f.value={from:V.from,callId:V.callId},o.value=!0,p.value=V.from):V.type==="call_response"&&V.to===r.value?V.accept?(d("info",`用户 ${V.from} 接听了呼叫`),await b(),await C(),c.value=!0,p.value=V.from):(d("info",`用户 ${V.from} 拒绝了呼叫`),E()):V.type==="hangup_call"&&V.to===r.value&&(await Rt(),d("info",`用户 ${V.from} 已挂断通话`))}catch(W){console.warn("parse custom message fail",W),d("error","接收广播消息异常: "+error.message)}}async function qe(D){console.log("🚀 ~ 发起呼叫");const O=D&&String(D).trim();if(!O){d("error","缺少呼叫目标,请传入目标用户ID");return}if(!l.value.includes(O)){d("error","用户不在线或未加入房间");return}o.value=!0,u.value=O,p.value=O;const W=`call_${Date.now()}_${Math.floor(Math.random()*1e4)}`,Y={type:"incoming_call",from:r.value,to:O,callId:W};await St(Y,1),d("info",`已向 ${O} 发起呼叫,等待应答`)}async function Rt(){try{await R(),await j();const D=`call_${Date.now()}_${Math.floor(Math.random()*1e4)}`,O={type:"hangup_call",from:r.value,to:u.value,callId:D};await St(O,3),E(),d("info","已挂断")}catch(D){console.warn("hangup fail",D),d("error","挂断失败:"+D)}}async function mt(){if(console.log("🚀 ~ 接听来电"),!f.value)return;const D={type:"call_response",from:r.value,to:f.value.from,callId:f.value.callId,accept:!0};await St(D,2),await b(),await C(),c.value=!0,u.value=f.value.from,p.value=f.value.from,f.value=null}async function vt(){if(console.log("🚀 ~ 拒绝来电"),f.value){const D={type:"call_response",from:r.value,to:f.value.from,callId:f.value.callId,accept:!1};await St(D,2),f.value=null,E();return}else Rt()}function Ae(){v.audio?R():b()}function ge(){v.video?j():C()}return e({handleCall:qe,init:S,show:k,hide:E,hangup:Rt}),N.onUnmounted(()=>{B()}),(D,O)=>(N.openBlock(),N.createBlock(N.Transition,{name:"callkit"},{default:N.withCtx(()=>[o.value?(N.openBlock(),N.createElementBlock("div",Es,[N.createElementVNode("div",Ss,N.toDisplayString(p.value),1),O[3]||(O[3]=N.createElementVNode("div",{class:"local-video",id:"local-video"},null,-1)),N.createElementVNode("div",{class:N.normalizeClass(["player-container",{single:s.value.length===1}])},[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(s.value,W=>(N.openBlock(),N.createElementBlock("div",{key:W,class:"remote",id:W,style:N.normalizeStyle({aspectRatio:h[W]||"16/9"})},null,12,xs))),128))],2),N.createElementVNode("div",Rs,[c.value?(N.openBlock(),N.createElementBlock(N.Fragment,{key:1},[N.createElementVNode("div",{class:N.normalizeClass(["equipment-btn operation-btn",v.audio?"equipment-btn--open":"equipment-btn--close"])},[N.createElementVNode("img",{src:v.audio?N.unref(ws):N.unref(ms),onClick:Ae},null,8,Ts),N.createElementVNode("div",null,N.toDisplayString(v.audio?"麦克风已开":"麦克风已关"),1)],2),N.createElementVNode("div",Is,[N.createElementVNode("img",{src:N.unref(wa),onClick:Rt},null,8,Ms),O[2]||(O[2]=N.createElementVNode("div",null,"挂断",-1))]),N.createElementVNode("div",{class:N.normalizeClass(["equipment-btn operation-btn",v.video?"equipment-btn--open":"equipment-btn--close"])},[N.createElementVNode("img",{src:v.video?N.unref(ys):N.unref(bs),onClick:ge},null,8,Ds),N.createElementVNode("div",null,N.toDisplayString(v.video?"摄像头已开":"摄像头已关"),1)],2)],64)):(N.openBlock(),N.createElementBlock(N.Fragment,{key:0},[f.value?(N.openBlock(),N.createElementBlock("div",As,[N.createElementVNode("img",{src:N.unref(vs),onClick:mt},null,8,Bs),O[0]||(O[0]=N.createElementVNode("div",null,"接听",-1))])):N.createCommentVNode("",!0),N.createElementVNode("div",Ls,[N.createElementVNode("img",{src:N.unref(wa),onClick:vt},null,8,zs),O[1]||(O[1]=N.createElementVNode("div",null,"挂断",-1))])],64))])])):N.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-d5ababf3"]]);It.BlTRTCCallKit=ma,It.default=ma,Object.defineProperties(It,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bl-trtc-callkit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "A Vue 3 component for TRTC video call",
|
|
7
|
-
"main": "dist/bl-trtc-callkit.umd.
|
|
6
|
+
"description": "A Vue 3 component for TRTC video call (For internal use within the company)",
|
|
7
|
+
"main": "dist/bl-trtc-callkit.umd.cjs",
|
|
8
8
|
"module": "dist/bl-trtc-callkit.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"import": "./dist/bl-trtc-callkit.js",
|
|
13
|
-
"require": "./dist/bl-trtc-callkit.umd.
|
|
14
|
-
"
|
|
14
|
+
"require": "./dist/bl-trtc-callkit.umd.cjs",
|
|
15
|
+
"style": "./dist/bl-trtc-callkit.css"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"files": [
|