feat: apiHost 改为 api.duooomi.com,ANI 转换参数可配置
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,10 +95,13 @@ val sdk = DuooomiBleSDK(
|
|||||||
| 参数 | 说明 |
|
| 参数 | 说明 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| `apiKey` | **必填**。用于 ANI 转换和固件查询等后端 API 鉴权。|
|
| `apiKey` | **必填**。用于 ANI 转换和固件查询等后端 API 鉴权。|
|
||||||
| `apiHost` | 默认 `https://api.mixvideo.bowong.cc`,一般无需修改 |
|
| `apiHost` | 默认 `https://api.duooomi.com`,一般无需修改 |
|
||||||
| `cdnHost` | 默认 `https://cdn.bowong.cc/`,一般无需修改 |
|
| `cdnHost` | 默认 `https://cdn.bowong.cc/`,一般无需修改 |
|
||||||
| `firmwareIdentifier` | 默认 `duomi`,设备固件标识符 |
|
| `firmwareIdentifier` | 默认 `duomi`,设备固件标识符 |
|
||||||
| `firmwareStatus` | 默认 `DRAFT`,可选 `PUBLISHED` |
|
| `firmwareStatus` | 默认 `DRAFT`,可选 `PUBLISHED` |
|
||||||
|
| `aniWidth` | ANI 转换宽度,默认 `360` |
|
||||||
|
| `aniHeight` | ANI 转换高度,默认 `360` |
|
||||||
|
| `aniFps` | ANI 转换帧率,默认 `"24"` |
|
||||||
|
|
||||||
## API 参考
|
## API 参考
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.duooomi.ble
|
package com.duooomi.ble
|
||||||
|
|
||||||
data class DuooomiBleConfig(
|
data class DuooomiBleConfig(
|
||||||
val apiHost: String = "https://api.mixvideo.bowong.cc",
|
val apiHost: String = "https://api.duooomi.com",
|
||||||
val apiKey: String,
|
val apiKey: String,
|
||||||
val cdnHost: String = "https://cdn.bowong.cc/",
|
val cdnHost: String = "https://cdn.bowong.cc/",
|
||||||
val firmwareIdentifier: String = "duomi",
|
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
|
val normalizedCdnHost: String
|
||||||
get() = if (cdnHost.endsWith("/")) cdnHost else "$cdnHost/"
|
get() = if (cdnHost.endsWith("/")) cdnHost else "$cdnHost/"
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ internal class AniConverter(private val config: DuooomiBleConfig) {
|
|||||||
|
|
||||||
val body = JSONObject().apply {
|
val body = JSONObject().apply {
|
||||||
put("videoUrl", fileUrl)
|
put("videoUrl", fileUrl)
|
||||||
put("width", 360)
|
put("width", config.aniWidth)
|
||||||
put("height", 360)
|
put("height", config.aniHeight)
|
||||||
put("fps", "24")
|
put("fps", config.aniFps)
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.outputStream.use { os ->
|
connection.outputStream.use { os ->
|
||||||
|
|||||||
Reference in New Issue
Block a user