ruiyun-human 1.0.4 → 1.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.
@@ -452,20 +452,24 @@ const _sfc_main = {
452
452
  const y = canvas.height - height;
453
453
  ctx.value.drawImage(image, x, y, width, height);
454
454
  };
455
- const stop = () => {
455
+ const stop = (keepAudio = false) => {
456
+ var _a;
456
457
  if (animationId.value) {
457
458
  cancelAnimationFrame(animationId.value);
458
459
  animationId.value = null;
459
460
  }
460
- try {
461
- currentAudio.value.pause();
462
- } catch (error) {
461
+ if (!keepAudio) {
462
+ try {
463
+ (_a = currentAudio.value) == null ? void 0 : _a.pause();
464
+ } catch (error) {
465
+ }
463
466
  }
464
467
  frameIndex.value = 1;
465
468
  animationState.value = "standby";
466
469
  };
467
470
  const runAnimation = (state) => {
468
- stop();
471
+ const keepAudio = state === "speak" || state === "speakLoop" || state === "speakEnd";
472
+ stop(keepAudio);
469
473
  animationState.value = state;
470
474
  loopDirection.value = 1;
471
475
  let currentFrames;
@@ -885,7 +889,7 @@ const _sfc_main = {
885
889
  };
886
890
  }
887
891
  };
888
- const DigitalHuman = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dd386539"]]);
892
+ const DigitalHuman = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b3682025"]]);
889
893
  DigitalHuman.install = (app) => app.component("DigitalHuman", DigitalHuman);
890
894
  const components = [DemoButton, DemoInput, DigitalHuman];
891
895
  const install = (app) => {
@@ -450,20 +450,24 @@ const _sfc_main = {
450
450
  const y = canvas.height - height;
451
451
  ctx.value.drawImage(image, x, y, width, height);
452
452
  };
453
- const stop = () => {
453
+ const stop = (keepAudio = false) => {
454
+ var _a;
454
455
  if (animationId.value) {
455
456
  cancelAnimationFrame(animationId.value);
456
457
  animationId.value = null;
457
458
  }
458
- try {
459
- currentAudio.value.pause();
460
- } catch (error) {
459
+ if (!keepAudio) {
460
+ try {
461
+ (_a = currentAudio.value) == null ? void 0 : _a.pause();
462
+ } catch (error) {
463
+ }
461
464
  }
462
465
  frameIndex.value = 1;
463
466
  animationState.value = "standby";
464
467
  };
465
468
  const runAnimation = (state) => {
466
- stop();
469
+ const keepAudio = state === "speak" || state === "speakLoop" || state === "speakEnd";
470
+ stop(keepAudio);
467
471
  animationState.value = state;
468
472
  loopDirection.value = 1;
469
473
  let currentFrames;
@@ -883,7 +887,7 @@ const _sfc_main = {
883
887
  };
884
888
  }
885
889
  };
886
- const DigitalHuman = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dd386539"]]);
890
+ const DigitalHuman = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b3682025"]]);
887
891
  DigitalHuman.install = (app) => app.component("DigitalHuman", DigitalHuman);
888
892
  const components = [DemoButton, DemoInput, DigitalHuman];
889
893
  const install = (app) => {
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .demo-btn[data-v-9a48516a]{padding:6px 14px;border-radius:4px;border:none;cursor:pointer;font-size:14px}.primary[data-v-9a48516a]{background:#409eff;color:#fff}.success[data-v-9a48516a]{background:#67c23a;color:#fff}.warning[data-v-9a48516a]{background:#e6a23c;color:#fff}.demo-input-wrap[data-v-28a3493c]{display:inline-flex;align-items:center;border:1px solid #dcdcdc;border-radius:4px;padding:0 10px}.demo-input-wrap[data-v-28a3493c]:focus-within{border-color:#409eff}.demo-input[data-v-28a3493c]{border:none;outline:none;padding:8px 6px;flex:1}.prefix[data-v-28a3493c],.suffix[data-v-28a3493c]{color:#909399}.digital-human[data-v-dd386539]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.digital-human canvas[data-v-dd386539]{max-width:100%;max-height:100%}
1
+ .demo-btn[data-v-9a48516a]{padding:6px 14px;border-radius:4px;border:none;cursor:pointer;font-size:14px}.primary[data-v-9a48516a]{background:#409eff;color:#fff}.success[data-v-9a48516a]{background:#67c23a;color:#fff}.warning[data-v-9a48516a]{background:#e6a23c;color:#fff}.demo-input-wrap[data-v-28a3493c]{display:inline-flex;align-items:center;border:1px solid #dcdcdc;border-radius:4px;padding:0 10px}.demo-input-wrap[data-v-28a3493c]:focus-within{border-color:#409eff}.demo-input[data-v-28a3493c]{border:none;outline:none;padding:8px 6px;flex:1}.prefix[data-v-28a3493c],.suffix[data-v-28a3493c]{color:#909399}.digital-human[data-v-b3682025]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.digital-human canvas[data-v-b3682025]{max-width:100%;max-height:100%}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruiyun-human",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "数字人初步实现",
6
6
  "main": "./dist/ruiyun-human.cjs.js",