feat: apiHost 改为 api.duooomi.com,ANI 转换参数可配置

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
km2023
2026-04-16 14:24:02 +08:00
parent 63dc4b7902
commit 79af43cdef
5 changed files with 24 additions and 21 deletions

View File

@@ -26,8 +26,11 @@ dependencies: [
```swift
let sdk = DuooomiBleSDK(config: .init(
apiKey: "your-api-key" //
// apiHost: URL(...)!, // https://api.mixvideo.bowong.cc
// apiHost: URL(...)!, // https://api.duooomi.com
// cdnHost: "https://cdn.bowong.cc/", //
// aniWidth: 360, // ANI 360
// aniHeight: 360, // ANI 360
// aniFps: "24", // ANI 24
// firmwareIdentifier: "duomi", //
// firmwareStatus: "DRAFT" //
))

View File

@@ -12,18 +12,30 @@ public struct DuooomiBleConfig: Sendable {
public let firmwareIdentifier: String
/// "DRAFT" / "PUBLISHED"
public let firmwareStatus: String
/// ANI
public let aniWidth: Int
/// ANI
public let aniHeight: Int
/// ANI
public let aniFps: String
public init(
apiHost: URL = URL(string: "https://api.mixvideo.bowong.cc")!,
apiHost: URL = URL(string: "https://api.duooomi.com")!,
apiKey: String,
cdnHost: String = "https://cdn.bowong.cc/",
firmwareIdentifier: String = "duomi",
firmwareStatus: String = "DRAFT"
firmwareStatus: String = "DRAFT",
aniWidth: Int = 360,
aniHeight: Int = 360,
aniFps: String = "24"
) {
self.apiHost = apiHost
self.apiKey = apiKey
self.cdnHost = cdnHost.hasSuffix("/") ? cdnHost : cdnHost + "/"
self.firmwareIdentifier = firmwareIdentifier
self.firmwareStatus = firmwareStatus
self.aniWidth = aniWidth
self.aniHeight = aniHeight
self.aniFps = aniFps
}
}

View File

@@ -43,9 +43,9 @@ final class AniConverter {
let body: [String: Any] = [
"videoUrl": fileUrl,
"width": 360,
"height": 360,
"fps": "24",
"width": config.aniWidth,
"height": config.aniHeight,
"fps": config.aniFps,
]
request.httpBody = try JSONSerialization.data(withJSONObject: body)

View File

@@ -33,7 +33,7 @@
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>api.mixvideo.bowong.cc</key>
<key>api.duooomi.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>

View File

@@ -15,17 +15,6 @@ settings:
packages: {}
targets:
DuooomiBleSDK:
type: framework
platform: iOS
sources:
- path: Sources/DuooomiBleSDK
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.duooomi.sdk
PRODUCT_NAME: DuooomiBleSDK
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
GENERATE_INFOPLIST_FILE: YES
demo:
type: application
platform: iOS
@@ -40,7 +29,7 @@ targets:
NSBluetoothAlwaysUsageDescription: "This app needs Bluetooth to communicate with your device"
NSAppTransportSecurity:
NSExceptionDomains:
api.mixvideo.bowong.cc:
api.duooomi.com:
NSIncludesSubdomains: true
NSExceptionAllowsInsecureHTTPLoads: true
NSExceptionMinimumTLSVersion: TLSv1.0
@@ -59,5 +48,4 @@ targets:
PRODUCT_BUNDLE_IDENTIFIER: com.duooomi.demo
PRODUCT_NAME: demo
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks"
dependencies:
- target: DuooomiBleSDK
dependencies: []