virtual-human-cf 1.4.0 → 1.5.0

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 CHANGED
@@ -13,8 +13,23 @@
13
13
 
14
14
  ## 更新日志
15
15
 
16
- ### 1.4.0
16
+ ### 1.5.0
17
+ - 新增VirtualHumanEventAdapter组件对外暴露play方法
18
+
19
+ ```javascript
20
+ <VirtualHumanEventAdapter
21
+ v-if="activeScreenClientId"
22
+ @controlEvent="onControlEvent"
23
+ ref="adapterRef"
24
+ />
25
+ const adapterRef = ref(null);
26
+
27
+ // 底部有使用demo,这里不重复
28
+ // 播放
29
+ adapterRef.value.play().then(() => {}).catch(() => {});
17
30
 
31
+ ```
32
+ ### 1.4.0
18
33
  - 新增VirtualHumanEventAdapter组件对外暴露pause、resume、stop方法
19
34
 
20
35
  ```javascript
@@ -181,10 +196,12 @@ const onEnded = () => {
181
196
 
182
197
  | 方法名 | 说明 | 回调参数 |
183
198
  | ------ | -------- | -------- |
199
+ | play | 播放 |Promise<boolean> |
184
200
  | pause | 暂停播放 |Promise<boolean> |
185
201
  | resume | 恢复播放 |Promise<boolean> |
186
202
  | stop | 停止播放 |Promise<boolean> |
187
203
 
204
+
188
205
  ```js
189
206
  // eventNotifaction 载荷数据
190
207
  {
@@ -253,6 +270,12 @@ const onError = (error) => {
253
270
 
254
271
  const adapterRef = ref(null);
255
272
  const controlFunc = () => {
273
+ // 播放
274
+ adapterRef.value.play().then(res => {
275
+ // res boolean true 播放成功 false 播放失败
276
+ }).catch((error) => {
277
+ console.error('播放失败:', error);
278
+ });
256
279
  // 暂停播放
257
280
  adapterRef.value.pause().then(res => {
258
281
  // res boolean true 暂停成功 false 暂停失败
@@ -11,6 +11,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
11
11
  required: true;
12
12
  };
13
13
  }>, {
14
+ play: () => Promise<boolean>;
14
15
  pause: () => Promise<boolean>;
15
16
  resume: () => Promise<boolean>;
16
17
  stop: () => Promise<boolean>;