@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
|
-
//
|
|
831
|
+
// 1. 视频和 HTML 走 CDN
|
|
832
|
+
// 2. 其余类型(PDF、文本、音频等)走本地 API (避免乱码或 CDN 延迟)
|
|
832
833
|
var assetExt = (asset.path || '').split('.').pop().toLowerCase();
|
|
833
|
-
var
|
|
834
|
-
|
|
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();
|