feat: 增加媒体格式校验,支持 JPEG、PNG、GIF、MP4、WebM、WebP 格式

This commit is contained in:
km2023
2026-04-20 15:40:22 +08:00
parent 1a7bbdc625
commit f42944bb58
3 changed files with 75 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ sdk.deleteFile(key: "file-key") { result in /* ... */ }
### 文件传输
```swift
// ANI prepare transfer
// ANI prepare transfer
sdk.transferMedia(fileUrl: "https://example.com/video.mp4") { result in
switch result {
case .success: print("Transfer complete")
@@ -120,6 +120,13 @@ sdk.transferMedia(fileUrl: "https://example.com/video.mp4") { result in
// delegate didUpdateProgress
```
**支持的媒体格式:** JPEG、PNG、GIF、MP4、WebM、WebP
格式校验规则:
- 优先从 URL path 提取扩展名(自动忽略查询参数)
- 无扩展名时通过 HEAD 请求检查 `Content-Type`
- 不支持的格式返回 `DuooomiBleError.unsupportedFormat`
### 固件升级
```swift