@agentscope-ai/design 1.0.26-beta.1768893648373 → 1.0.26-beta.1768906295632

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.
@@ -13,7 +13,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import React, { forwardRef, useEffect, useState, useRef } from 'react';
16
+ import React, { forwardRef, useEffect, useState, useRef, useCallback } from 'react';
17
17
  import classNames from 'classnames';
18
18
  import MediaPlayerController from "../Audio/Control";
19
19
  import { useControllableValue } from 'ahooks';
@@ -104,10 +104,7 @@ var Video = /*#__PURE__*/forwardRef(function (props, ref) {
104
104
  }
105
105
  };
106
106
  }, [isPlaying]);
107
-
108
- // 检测视频是否有音频通道
109
- var handleCanPlayThrough = function handleCanPlayThrough(e) {
110
- var _videoProps$onCanPlay;
107
+ var checkHasAudio = useCallback(function () {
111
108
  if (videoRef.current) {
112
109
  // 方法1: 检查mozHasAudio属性 (Firefox)
113
110
  if ('mozHasAudio' in videoRef.current) {
@@ -122,7 +119,15 @@ var Video = /*#__PURE__*/forwardRef(function (props, ref) {
122
119
  setEnableVolume(false);
123
120
  }
124
121
  }
122
+ }, []);
123
+
124
+ // 检测视频是否有音频通道
125
+ var handleCanPlayThrough = function handleCanPlayThrough(e) {
126
+ var _videoProps$onCanPlay;
125
127
  (_videoProps$onCanPlay = videoProps.onCanPlayThrough) === null || _videoProps$onCanPlay === void 0 || _videoProps$onCanPlay.call(videoProps, e);
128
+ setTimeout(function () {
129
+ checkHasAudio();
130
+ }, 100);
126
131
  };
127
132
 
128
133
  // 视频加载完成处理
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/design",
3
- "version": "1.0.26-beta.1768893648373",
3
+ "version": "1.0.26-beta.1768906295632",
4
4
  "description": "AgentScope Spark Design - UI Library for AgentScope AI",
5
5
  "repository": {
6
6
  "type": "git",