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:26:18 +08:00
parent 18c6f5e098
commit 1bcf838a15
3 changed files with 15 additions and 6 deletions

View File

@@ -95,10 +95,13 @@ val sdk = DuooomiBleSDK(
| 参数 | 说明 |
|------|------|
| `apiKey` | **必填**。用于 ANI 转换和固件查询等后端 API 鉴权。|
| `apiHost` | 默认 `https://api.mixvideo.bowong.cc`,一般无需修改 |
| `apiHost` | 默认 `https://api.duooomi.com`,一般无需修改 |
| `cdnHost` | 默认 `https://cdn.bowong.cc/`,一般无需修改 |
| `firmwareIdentifier` | 默认 `duomi`,设备固件标识符 |
| `firmwareStatus` | 默认 `DRAFT`,可选 `PUBLISHED` |
| `aniWidth` | ANI 转换宽度,默认 `360` |
| `aniHeight` | ANI 转换高度,默认 `360` |
| `aniFps` | ANI 转换帧率,默认 `"24"` |
## API 参考

View File

@@ -1,11 +1,17 @@
package com.duooomi.ble
data class DuooomiBleConfig(
val apiHost: String = "https://api.mixvideo.bowong.cc",
val apiHost: String = "https://api.duooomi.com",
val apiKey: String,
val cdnHost: String = "https://cdn.bowong.cc/",
val firmwareIdentifier: String = "duomi",
val firmwareStatus: String = "DRAFT"
val firmwareStatus: String = "DRAFT",
/** ANI 转换宽度(像素) */
val aniWidth: Int = 360,
/** ANI 转换高度(像素) */
val aniHeight: Int = 360,
/** ANI 转换帧率 */
val aniFps: String = "24"
) {
val normalizedCdnHost: String
get() = if (cdnHost.endsWith("/")) cdnHost else "$cdnHost/"

View File

@@ -35,9 +35,9 @@ internal class AniConverter(private val config: DuooomiBleConfig) {
val body = JSONObject().apply {
put("videoUrl", fileUrl)
put("width", 360)
put("height", 360)
put("fps", "24")
put("width", config.aniWidth)
put("height", config.aniHeight)
put("fps", config.aniFps)
}
connection.outputStream.use { os ->