@aiyiran/myclaw 1.1.33 → 1.1.34

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.
@@ -828,10 +828,14 @@
828
828
  'background: #fff',
829
829
  ].join(';');
830
830
 
831
- // 大文件(音频/视频)走 CDN,其余走本地 server(避免 CDN 无 charset 导致乱码)
831
+ // 1. 视频和 HTML CDN
832
+ // 2. 其余类型(PDF、文本、音频等)走本地 API (避免乱码或 CDN 延迟)
832
833
  var assetExt = (asset.path || '').split('.').pop().toLowerCase();
833
- var CDN_EXTS = ['mp3', 'wav', 'ogg', 'flac', 'aac', 'm4a', 'mp4', 'webm', 'mov', 'avi', 'mkv'];
834
- if (CDN_EXTS.indexOf(assetExt) !== -1) {
834
+ var VIDEO_EXTS = ['mp4', 'webm', 'mov', 'avi', 'mkv'];
835
+ var isHtml = assetExt === 'html' || assetExt === 'htm';
836
+ var isVideo = VIDEO_EXTS.indexOf(assetExt) !== -1;
837
+
838
+ if (isHtml || isVideo) {
835
839
  iframe.src = previewUrl + '?t=' + Date.now();
836
840
  } else {
837
841
  iframe.src = MYCLAW_API_BASE + '/api/file?path=' + encodeURIComponent(getWorkspaceId() + '/' + asset.path) + '&t=' + Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.1.33",
3
+ "version": "1.1.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {