@tencentcloud/sdk-mcp 1.7.7 → 1.7.9-beta.1

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.
Files changed (224) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -9
  3. package/index.js +8 -8
  4. package/knowledge/chunker.js +1 -0
  5. package/knowledge/doc-url-resolver.js +16 -9
  6. package/knowledge/embedding/build-vectors.js +92 -0
  7. package/knowledge/embedding/embed-model.js +41 -0
  8. package/knowledge/embedding/vector-augment.js +126 -0
  9. package/knowledge/embedding/vector-index.js +70 -0
  10. package/knowledge/frontmatter-meta.js +23 -0
  11. package/knowledge/path-meta.js +56 -0
  12. package/knowledge/search/exact-lookup.js +145 -16
  13. package/knowledge/search/filter-pool.js +77 -33
  14. package/knowledge/search/rank-profile.js +25 -0
  15. package/knowledge/search/requires-framework.js +4 -1
  16. package/knowledge/search/search-core.js +74 -13
  17. package/knowledge/search/search-knowledge.js +24 -34
  18. package/knowledge/search/search-pass.js +495 -169
  19. package/knowledge/search/url-row-scorer.js +24 -6
  20. package/package.json +3 -1
  21. package/resource/index/manifest.json +1 -1
  22. package/resource/index/vectors/index.json +4 -0
  23. package/resource/integration/callkit/preset/android/integration.md +0 -2
  24. package/resource/integration/callkit/preset/ios/integration.md +0 -2
  25. package/resource/integration/chat/preset/react/integration.md +9 -5
  26. package/resource/integration/chat/preset/uni-app/integration.md +4 -0
  27. package/resource/integration/chat/preset/vue/integration.md +10 -6
  28. package/resource/integration/livekit/preset/live/android/prepare-integration.md +0 -4
  29. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +0 -4
  30. package/resource/integration/roomkit/preset/vue/integration.md +154 -208
  31. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +0 -2
  32. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +0 -2
  33. package/resource/knowledge/callkit/core-sdk/android/make-call.md +0 -2
  34. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +0 -4
  35. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +0 -2
  36. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +0 -2
  37. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +0 -2
  38. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +0 -4
  39. package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +0 -2
  40. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +0 -2
  41. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +0 -2
  42. package/resource/knowledge/callkit/faq/ios.md +0 -2
  43. package/resource/knowledge/callkit/faq/uniapp-app.md +0 -2
  44. package/resource/knowledge/callkit/preset/miniprogram/integration.md +2 -3
  45. package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +0 -2
  46. package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -16
  47. package/resource/knowledge/chat/preset/react/h5/integration.md +16 -5
  48. package/resource/knowledge/chat/preset/vue/features/conversation-list.md +6 -3
  49. package/resource/knowledge/chat/preset/vue/h5/integration.md +7 -4
  50. package/resource/knowledge/iot/app/activate-service.md +95 -0
  51. package/resource/knowledge/iot/app/demo/android.md +93 -0
  52. package/resource/knowledge/iot/app/demo/ios.md +87 -0
  53. package/resource/knowledge/iot/app/demo/miniprogram.md +79 -0
  54. package/resource/knowledge/iot/app/device-binding.md +378 -0
  55. package/resource/knowledge/iot/app/device-sharing.md +414 -0
  56. package/resource/knowledge/iot/app/family-management.md +762 -0
  57. package/resource/knowledge/iot/app/integration/android.md +328 -0
  58. package/resource/knowledge/iot/app/integration/harmonyos.md +326 -0
  59. package/resource/knowledge/iot/app/integration/ios.md +351 -0
  60. package/resource/knowledge/iot/app/integration/miniprogram.md +268 -0
  61. package/resource/knowledge/iot/app/monitor-playback.md +557 -0
  62. package/resource/knowledge/iot/app/remote-control.md +139 -0
  63. package/resource/knowledge/iot/app/video-call.md +559 -0
  64. package/resource/knowledge/iot/app/wechat-call/device-call-miniprogram.md +204 -0
  65. package/resource/knowledge/iot/app/wechat-call/miniprogram-call-device.md +193 -0
  66. package/resource/knowledge/iot/client-api/app/android/txiotcallsession.md +189 -0
  67. package/resource/knowledge/iot/client-api/app/android/txiotcloudstorage.md +77 -0
  68. package/resource/knowledge/iot/client-api/app/android/txiotdevicemanager.md +175 -0
  69. package/resource/knowledge/iot/client-api/app/android/txiotengine.md +172 -0
  70. package/resource/knowledge/iot/client-api/app/android/txiotenginedef.md +163 -0
  71. package/resource/knowledge/iot/client-api/app/android/txiotfamilymanager.md +146 -0
  72. package/resource/knowledge/iot/client-api/app/android/txiotmonitorsession.md +246 -0
  73. package/resource/knowledge/iot/client-api/app/harmonyos/txiotcallsession.md +191 -0
  74. package/resource/knowledge/iot/client-api/app/harmonyos/txiotcloudstorage.md +77 -0
  75. package/resource/knowledge/iot/client-api/app/harmonyos/txiotdevicemanager.md +183 -0
  76. package/resource/knowledge/iot/client-api/app/harmonyos/txiotengine.md +186 -0
  77. package/resource/knowledge/iot/client-api/app/harmonyos/txiotenginedef.md +164 -0
  78. package/resource/knowledge/iot/client-api/app/harmonyos/txiotfamilymanager.md +150 -0
  79. package/resource/knowledge/iot/client-api/app/harmonyos/txiotmonitorsession.md +252 -0
  80. package/resource/knowledge/iot/client-api/app/ios/txiotcallsession.md +199 -0
  81. package/resource/knowledge/iot/client-api/app/ios/txiotcloudstorage.md +76 -0
  82. package/resource/knowledge/iot/client-api/app/ios/txiotdevicemanager.md +173 -0
  83. package/resource/knowledge/iot/client-api/app/ios/txiotengine.md +173 -0
  84. package/resource/knowledge/iot/client-api/app/ios/txiotenginedef.md +171 -0
  85. package/resource/knowledge/iot/client-api/app/ios/txiotfamilymanager.md +146 -0
  86. package/resource/knowledge/iot/client-api/app/ios/txiotmonitorsession.md +250 -0
  87. package/resource/knowledge/iot/client-api/app/miniprogram/txiotcallsession.md +180 -0
  88. package/resource/knowledge/iot/client-api/app/miniprogram/txiotcloudstorage.md +76 -0
  89. package/resource/knowledge/iot/client-api/app/miniprogram/txiotdevicemanager.md +281 -0
  90. package/resource/knowledge/iot/client-api/app/miniprogram/txiotengine.md +183 -0
  91. package/resource/knowledge/iot/client-api/app/miniprogram/txiotenginedef.md +152 -0
  92. package/resource/knowledge/iot/client-api/app/miniprogram/txiotfamilymanager.md +179 -0
  93. package/resource/knowledge/iot/client-api/app/miniprogram/txiotmonitorsession.md +226 -0
  94. package/resource/knowledge/iot/client-api/device/android-smart-device.md +813 -0
  95. package/resource/knowledge/iot/client-api/device/linux-rtos-device.md +2027 -0
  96. package/resource/knowledge/iot/device/activate-service.md +167 -0
  97. package/resource/knowledge/iot/device/ai-voice-chat/advanced-features/custom-agent.md +171 -0
  98. package/resource/knowledge/iot/device/ai-voice-chat/advanced-features/smart-device-control.md +721 -0
  99. package/resource/knowledge/iot/device/ai-voice-chat/integration-guide/android-smart-device.md +247 -0
  100. package/resource/knowledge/iot/device/ai-voice-chat/integration-guide/linux-rtos-device.md +368 -0
  101. package/resource/knowledge/iot/device/ai-voice-chat/overview.md +84 -0
  102. package/resource/knowledge/iot/device/cloud-storage.md +696 -0
  103. package/resource/knowledge/iot/device/data-model.md +972 -0
  104. package/resource/knowledge/iot/device/demo/android-smart-device.md +97 -0
  105. package/resource/knowledge/iot/device/demo/linux-rtos-device.md +106 -0
  106. package/resource/knowledge/iot/device/device-ota-upgrade.md +237 -0
  107. package/resource/knowledge/iot/device/dynamic-registration/android-smart-device.md +275 -0
  108. package/resource/knowledge/iot/device/dynamic-registration/linux-rtos-device.md +297 -0
  109. package/resource/knowledge/iot/device/login-and-register/android-smart-device.md +131 -0
  110. package/resource/knowledge/iot/device/login-and-register/linux-rtos-device.md +291 -0
  111. package/resource/knowledge/iot/device/monitor-pushing/android-smart-device.md +237 -0
  112. package/resource/knowledge/iot/device/monitor-pushing/linux-rtos-device.md +493 -0
  113. package/resource/knowledge/iot/device/video-call/android-smart-device.md +299 -0
  114. package/resource/knowledge/iot/device/video-call/linux-rtos-device.md +465 -0
  115. package/resource/knowledge/iot/device/wechat-call/android-smart-device.md +534 -0
  116. package/resource/knowledge/iot/device/wechat-call/linux-rtos-device.md +681 -0
  117. package/resource/knowledge/iot/kids-watch/overview.md +28 -0
  118. package/resource/knowledge/iot/security-camera/activate-service.md +74 -0
  119. package/resource/knowledge/iot/security-camera/monitor-playback/app-integration.md +302 -0
  120. package/resource/knowledge/iot/security-camera/monitor-playback/device-integration/android.md +237 -0
  121. package/resource/knowledge/iot/security-camera/monitor-playback/device-integration/linux-rtos.md +493 -0
  122. package/resource/knowledge/iot/security-camera/overview.md +31 -0
  123. package/resource/knowledge/iot/security-camera/ptz-control.md +153 -0
  124. package/resource/knowledge/iot/security-camera/recording-and-snapshot.md +182 -0
  125. package/resource/knowledge/iot/security-camera/voice-intercom.md +174 -0
  126. package/resource/knowledge/iot/smart-vision/serviceoverview.md +114 -0
  127. package/resource/knowledge/iot/voice-recorder/app-demo.md +99 -0
  128. package/resource/knowledge/iot/voice-recorder/device-demo.md +189 -0
  129. package/resource/knowledge/iot/voice-recorder/overview.md +64 -0
  130. package/resource/knowledge/livekit/core-sdk/features/android/base-beauty.md +0 -2
  131. package/resource/knowledge/livekit/core-sdk/features/android/gift.md +0 -4
  132. package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +0 -2
  133. package/resource/knowledge/livekit/core-sdk/features/flutter/audio-effect.md +0 -2
  134. package/resource/knowledge/livekit/core-sdk/features/flutter/base-beauty.md +0 -2
  135. package/resource/knowledge/livekit/core-sdk/features/flutter/gift.md +0 -4
  136. package/resource/knowledge/livekit/core-sdk/features/ios/base-beauty.md +0 -2
  137. package/resource/knowledge/livekit/core-sdk/features/ios/gift.md +0 -4
  138. package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +0 -2
  139. package/resource/knowledge/livekit/core-sdk/features/uni-app/base-beauty.md +0 -2
  140. package/resource/knowledge/livekit/core-sdk/features/uni-app/gift.md +0 -4
  141. package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +0 -4
  142. package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +0 -10
  143. package/resource/knowledge/livekit/core-sdk/live/android/integration.md +0 -2
  144. package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +0 -2
  145. package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +0 -10
  146. package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +0 -2
  147. package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +0 -4
  148. package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +0 -10
  149. package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +0 -2
  150. package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +0 -4
  151. package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +0 -4
  152. package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +0 -2
  153. package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +0 -2
  154. package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +0 -4
  155. package/resource/knowledge/livekit/core-sdk/voice/android/integration.md +0 -4
  156. package/resource/knowledge/livekit/core-sdk/voice/flutter/integration.md +0 -2
  157. package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +0 -2
  158. package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +0 -4
  159. package/resource/knowledge/livekit/core-sdk/voice/ios/integration.md +0 -4
  160. package/resource/knowledge/livekit/core-sdk/voice/uni-app/co-guest-interaction.md +0 -2
  161. package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +0 -2
  162. package/resource/knowledge/livekit/faq/error-code.md +0 -2
  163. package/resource/knowledge/push/config/android/honor.md +16 -1
  164. package/resource/knowledge/push/config/android/huawei.md +20 -4
  165. package/resource/knowledge/push/config/android/meizu.md +19 -5
  166. package/resource/knowledge/push/config/android/vivo.md +20 -1
  167. package/resource/knowledge/push/config/donut.md +0 -2
  168. package/resource/knowledge/push/config/harmonyos.md +21 -5
  169. package/resource/knowledge/push/integration/android.md +0 -5
  170. package/resource/knowledge/push/integration/donut.md +0 -3
  171. package/resource/knowledge/push/integration/flutter.md +1 -4
  172. package/resource/knowledge/push/integration/harmonyos.md +0 -3
  173. package/resource/knowledge/push/integration/ios.md +0 -3
  174. package/resource/knowledge/push/integration/react-native.md +0 -5
  175. package/resource/knowledge/push/integration/uni-app.md +0 -3
  176. package/resource/knowledge/push/integration/unity.md +0 -3
  177. package/resource/knowledge/push/integration/unreal-engine.md +0 -3
  178. package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +0 -2
  179. package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +0 -2
  180. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +0 -2
  181. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +0 -2
  182. package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +0 -2
  183. package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +0 -2
  184. package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +0 -2
  185. package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +0 -2
  186. package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +0 -2
  187. package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +0 -2
  188. package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +0 -2
  189. package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +0 -2
  190. package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -3
  191. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +18 -14
  192. package/resource/knowledge/rtcengine/web/how_to_run_web_sdk_demo.md +0 -2
  193. package/resource/knowledge/rtcengine/web/plugin/23-advanced-support-detection.md +30 -0
  194. package/resource/knowledge/rtcengine/web/plugin/24-advanced-network-quality.md +0 -2
  195. package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
  196. package/resource/knowledge/rtcengine/web/plugin/35-advanced-ai-denoiser.md +1 -1
  197. package/resource/knowledge/rtcengine/web/plugin/36-advanced-virtual-background.md +4 -0
  198. package/resource/knowledge/trtc/android/TRTCCloud.md +94 -85
  199. package/resource/knowledge/trtc/android/TRTCCloudDef.md +48 -46
  200. package/resource/knowledge/trtc/android/TRTCCloudListener.md +48 -48
  201. package/resource/knowledge/trtc/android/TXAudioEffectManager.md +18 -18
  202. package/resource/knowledge/trtc/android/TXDeviceManager.md +4 -4
  203. package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -0
  204. package/resource/knowledge/trtc/c++/ITRTCCloud.md +90 -90
  205. package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +18 -18
  206. package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -9
  207. package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +47 -47
  208. package/resource/knowledge/trtc/c++/TRTCTypeDef.md +47 -45
  209. package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -0
  210. package/resource/knowledge/trtc/ios/TRTCCloud.md +93 -93
  211. package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +50 -50
  212. package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +8 -8
  213. package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -9
  214. package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -0
  215. package/resource/knowledge/trtc/ios/TXLiveSDKTypeDef.md +48 -46
  216. package/server-config.js +8 -9
  217. package/server.js +1 -1
  218. package/tools/common/finalize_answer.js +1 -1
  219. package/tools/common/present_framework_choice.js +1 -1
  220. package/tools/common/search_trtc_knowledge.js +22 -3
  221. package/tools/definitions/search_trtc_knowledge_def.js +3 -2
  222. package/utils/preflight-route.js +19 -2
  223. package/utils/report-cls-client.js +1 -1
  224. package/utils/report-es-client.js +1 -1
@@ -0,0 +1,204 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - minprogram
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: app
9
+ ---
10
+
11
+ TWeCall 是腾讯云物联网开发平台提供的设备与微信小程序之间的双向音视频通话能力。设备端一键呼叫后,微信通过「服务通知」强提醒用户,点击即可进入通话,达到微信原生通话体验。
12
+
13
+ 本文将介绍小程序端如何接入 TWeCall(微信通话),实现**接听设备端发起的音视频呼叫**,帮助您快速完成设备呼叫微信场景的小程序端接入。
14
+
15
+ ## 前提条件
16
+ - 已完成 集成与登录 文档中的登录功能,小程序成功登录。
17
+
18
+ - 已在物联网开发平台完成 TWeCall 服务激活与小程序授权。
19
+
20
+ - 已完成小程序的硬件设备接入并获取 model_id:在小程序管理后台的**设置 > 基本设置 > 服务类目**中添加「工具 > 设备管理」类目,然后在**功能 > 硬件设备**中添加设备,审核通过后平台在设备管理列表分配 model_id。详细流程请参见 开通服务 的 小程序申请硬件能力 章节及微信官方 [硬件设备接入指引](https://developers.weixin.qq.com/miniprogram/dev/framework/device/device-access)。
21
+
22
+ ## 接入流程
23
+
24
+ 小程序端接入分为以下四步:
25
+ 1. 绑定设备到家庭:设备须先归属某个家庭,才能对该设备发起呼叫。
26
+
27
+ 2. 接入 wmpf-voip 插件:通话接听页由微信官方 wmpf-voip 插件承载。
28
+
29
+ 3. 注册 VoIP 通话权限:为指定设备完成微信侧授权,授权后设备才能呼叫当前用户。
30
+
31
+ 4. 查询与管理授权状态:查询设备已授权的用户,或注销设备的 VoIP 通话权限。
32
+
33
+ ## 接入步骤
34
+
35
+ ### 步骤 1:绑定设备到家庭
36
+
37
+ 用户使用 TWeCall 前,需要先把设备绑定到家庭中。绑定凭证为设备绑定签名(deviceBindSignature),由设备配网流程或设备机身二维码提供,详细绑定流程。
38
+ ``` javascript
39
+ const plugin = requirePlugin('tx-iot-sdk');
40
+ const engine = plugin.TXIoTEngine.getInstance();
41
+ const familyManager = engine.getFamilyManager();
42
+ const deviceManager = engine.getDeviceManager();
43
+
44
+ // 1. 获取家庭列表;首次使用可先通过 createFamily 创建家庭
45
+ const families = await familyManager.getFamilyList();
46
+ const familyId = families[0]?.familyId;
47
+
48
+ // 2. 使用设备绑定签名将设备绑定到家庭
49
+ // deviceBindSignature 由设备配网流程或扫描设备机身二维码获取
50
+ const deviceBindSignature = 'YOUR_DEVICE_BIND_SIGNATURE';
51
+ const deviceInfo = await deviceManager.bindDevice(familyId, deviceBindSignature);
52
+ ```
53
+
54
+ 绑定成功后,设备会出现在 getDeviceList 的返回结果中。相关接口说明。
55
+
56
+ ### 步骤 2:接入 wmpf-voip 插件
57
+
58
+ 接听 UI 由微信官方 **wmpf-voip** 插件(AppID:wxf830863afde621eb)的通话页承载,宿主小程序需在 **app.json** 中声明插件:
59
+ ``` json
60
+ {
61
+ "plugins": {
62
+ "wmpf-voip": {
63
+ "version": "latest",
64
+ "provider": "wxf830863afde621eb"
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ 在小程序启动时(如 App 的 `onLaunch` 中)对插件进行初始化:
71
+ ``` javascript
72
+ const wmpfVoip = requirePlugin('wmpf-voip').default;
73
+
74
+ // 接听页 UI 定制(按需配置)
75
+ wmpfVoip.setUIConfig({
76
+ // ...
77
+ });
78
+
79
+ // 通话结束后跳转的宿主小程序页面路径
80
+ wmpfVoip.setVoipEndPagePath({
81
+ url: '/pages/call-end/call-end',
82
+ key: 'Call',
83
+ });
84
+
85
+ // 监听通话事件
86
+ wmpfVoip.onVoipEvent((event) => {
87
+ console.log(event.eventName, event);
88
+ });
89
+ ```
90
+
91
+ ### 步骤 3:注册微信 VoIP 通话权限
92
+
93
+ 设备只能呼叫已完成微信 VoIP 授权的用户。注册流程分为三个子步骤,需依次完成。
94
+
95
+ #### 3.1 获取授权票据
96
+
97
+ 调用 requestVoIPSnTicket 获取设备的 SN 与 snTicket(授权票据):
98
+ ``` javascript
99
+ const deviceManager = engine.getDeviceManager();
100
+
101
+ // deviceId:设备标识,productId / deviceName 为物联网开发平台上的产品 ID 与设备名称
102
+ const deviceId = { productId: 'YOUR_PRODUCT_ID', deviceName: 'YOUR_DEVICE_NAME' };
103
+ // modelId:微信公众平台「设备接入」分配的 model_id
104
+ const modelId = 'YOUR_MODEL_ID';
105
+ // appId:当前宿主小程序的 AppID
106
+ const appId = 'YOUR_MINIPROGRAM_APPID';
107
+
108
+ const { sn, snTicket } = await deviceManager.requestVoIPSnTicket(deviceId, modelId, appId);
109
+ ```
110
+
111
+ #### 3.2 拉起微信授权弹窗
112
+
113
+ 使用上一步获取的票据调用 `wx.requestDeviceVoIP`,拉起微信侧授权弹窗。该接口为微信原生 API,必须由宿主小程序在小程序上下文调用(插件上下文无此 API):
114
+ ``` javascript
115
+ wx.requestDeviceVoIP({
116
+ sn,
117
+ snTicket, // 第 3.1 步获取,5 分钟内有效
118
+ modelId,
119
+ deviceName: "设备名称", // 授权弹窗中显示的设备名,不超过 13 个字符
120
+ success(res) {
121
+ console.log('requestDeviceVoIP success:', res);
122
+ // 授权成功,继续执行第 3.3 步完成授权登记
123
+ },
124
+ fail(err) {
125
+ // errCode 10001 表示用户此前已授权,可视为成功
126
+ console.error('requestDeviceVoIP fail:', err);
127
+ },
128
+ });
129
+ ```
130
+
131
+ > **注意:**
132
+ > - 用户拒绝过授权后,再次调用 `wx.requestDeviceVoIP` 不再弹窗,须引导用户到小程序设置页手动开启。
133
+ > - 用户删除小程序后重新打开,授权状态会失效,需要重新执行本步骤。查询设备的授权状态参见步骤4中的 查询小程序已授权的设备。
134
+
135
+ #### 3.3 添加到设备的联系人列表中
136
+
137
+ 微信侧授权成功后,调用 registerVoIPNotificationForDevice 将当前用户的微信 OpenID 添加到设备的联系人列表中,完成授权闭环:
138
+ ``` javascript
139
+ // wxOpenId:当前用户的微信 OpenID
140
+ const wxOpenId = 'USER_WX_OPENID';
141
+
142
+ await deviceManager.registerVoIPNotificationForDevice(deviceId, modelId, appId, wxOpenId);
143
+ ```
144
+
145
+ 授权登记成功后,设备端即可发起呼叫,呼叫到达时微信会弹出「服务通知」提醒用户接听。
146
+
147
+ ### 步骤 4:查询与管理授权状态
148
+
149
+ #### 查询设备联系人列表
150
+
151
+ 调用 getAuthorizedVoIPUserList 获取允许呼叫对应设备的微信用户 OpenID 列表,设备端 SDK 不允许呼叫联系人列表以外的用户:
152
+ ``` javascript
153
+ const openIds = await deviceManager.getAuthorizedVoIPUserList(deviceId);
154
+ const isInContactList = openIds.includes(wxOpenId);
155
+ ```
156
+
157
+ #### 查询微信授权的设备列表
158
+
159
+ 调用 [wx.getDeviceVoIPList](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.getDeviceVoIPList.html) 获取哪些设备允许通过微信 VoIP 呼叫当前用户。小程序被删除后再重新打开,已授权的设备会被清空。通过判断设备是否在本列表中,决定是否要重新执行步骤3。
160
+ ``` javascript
161
+ const wxAny = wx as any;
162
+ if (typeof wxAny.getDeviceVoIPList === 'function') {
163
+ wxAny.getDeviceVoIPList({
164
+ success: (res: { list?: any[] }) => {
165
+ // 判断 res.list 中是否包含目标设备的 sn (sn 由 productId + deviceName 组成)
166
+ },
167
+ fail: (err: { errMsg?: string }) => {
168
+ console.warn('[device] wx.getDeviceVoIPList fail:', err && err.errMsg);
169
+ },
170
+ });
171
+ }
172
+ ```
173
+
174
+ #### 从设备联系人列表中移除
175
+
176
+ 当用户不想再接收来自设备的呼叫时,调用 unregisterVoIPNotificationForDevice 将自己从设备联系人列表中移除,移除后设备再呼叫该用户时不会触发微信提醒:
177
+ ``` javascript
178
+ await deviceManager.unregisterVoIPNotificationForDevice(deviceId, modelId, appId, wxOpenId);
179
+ ```
180
+
181
+ ## 常见问题
182
+
183
+ ### model_id 在哪里查看?
184
+
185
+ 在小程序管理后台的**功能 > 硬件设备 > 设备管理**列表中查看。设备需先通过微信审核(约1-3天),审核通过后平台才会分配 model_id。
186
+
187
+ ### 授权弹窗没有弹出?
188
+ - 检查 snTicket 是否在5分钟有效期内,过期需重新调用 `requestVoIPSnTicket`。
189
+
190
+ - 用户此前拒绝过授权的,微信不再自动弹窗,须引导用户到小程序设置页手动开启。
191
+
192
+ - `fail` 回调中 errCode 为 10001 表示用户已授权,属于成功场景,可直接进入授权登记。
193
+
194
+ ### 设备呼叫后用户收不到提醒?
195
+ - 确认用户已完成步骤3的授权登记,可通过 `getAuthorizedVoIPUserList` 校验。
196
+
197
+ - 确认用户未删除过小程序;删除后重新打开授权状态会失效,需重新注册。
198
+
199
+ ## 相关文档
200
+ - TXIoTDeviceManager:设备绑定、VoIP 授权等接口的完整说明。
201
+
202
+ - 设备端接入:设备侧呼叫微信的对接流程。
203
+
204
+ - 集成与登录:小程序 SDK 集成与登录。
@@ -0,0 +1,193 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - minprogram
5
+ types:
6
+ - feature
7
+ retrievable_scope: always
8
+ feature_domain: app
9
+ ---
10
+
11
+ 本文将介绍小程序端如何接入 TWeCall(微信通话),实现**向设备端发起音视频呼叫**,帮助您快速完成小程序呼叫设备场景的接入。
12
+
13
+ TWeCall 是腾讯云物联网开发平台提供的设备与微信小程序之间的双向音视频通话能力。小程序端通过 TXIoTCallSession 发起呼叫,设备端接听后即可进行音视频通话。
14
+
15
+ ## 前提条件
16
+ - 已完成 集成与登录 文档中的登录功能,小程序成功登录。
17
+
18
+ - 已在物联网开发平台完成 TWeCall 服务激活与小程序授权。
19
+
20
+ ## 接入流程
21
+
22
+ 小程序向设备端发起呼叫分为以下三步:
23
+ 1. 绑定设备到家庭:设备须先归属某个家庭,才能对其发起通话。
24
+
25
+ 2. 添加渲染组件:在通话页面放置 `iot-pusher` 与 `iot-player` 组件。
26
+
27
+ 3. 发起通话:获取通话会话、监听通话事件、绑定渲染组件后呼叫设备。
28
+
29
+ ## 接入步骤
30
+
31
+ ### 步骤 1:绑定设备到家庭
32
+
33
+ 设备必须先绑定到家庭后才能发起通话。通过 bindDevice 使用设备绑定签名直接绑定,详细流程。
34
+ ``` javascript
35
+ const plugin = requirePlugin('tx-iot-sdk');
36
+ const engine = plugin.TXIoTEngine.getInstance();
37
+ const familyManager = engine.getFamilyManager();
38
+ const deviceManager = engine.getDeviceManager();
39
+
40
+ // 1. 获取家庭列表;首次使用可先通过 createFamily 创建家庭
41
+ const families = await familyManager.getFamilyList();
42
+ const familyId = families[0]?.familyId;
43
+
44
+ // 2. 使用设备绑定签名将设备绑定到家庭
45
+ // deviceBindSignature 由设备配网流程或扫描设备机身二维码获取
46
+ const deviceBindSignature = 'YOUR_DEVICE_BIND_SIGNATURE';
47
+ const deviceInfo = await deviceManager.bindDevice(familyId, deviceBindSignature);
48
+ ```
49
+
50
+ 绑定成功后,设备会出现在 getDeviceList 的返回结果中。
51
+
52
+ ### 步骤 2:添加渲染组件
53
+
54
+ 通话页面需要放置两个渲染组件:`iot-pusher` 负责本端音视频的采集与推流,`openMicrophone`、`openCamera` 等接口采集的声音和画面通过该组件推送给设备端;`iot-player` 负责渲染设备端的音视频画面与声音。
55
+
56
+ 首先在页面 JSON 中声明组件:
57
+ ``` json
58
+ {
59
+ "usingComponents": {
60
+ "iot-pusher": "plugin://tx-iot-sdk/iot-pusher",
61
+ "iot-player": "plugin://tx-iot-sdk/iot-player"
62
+ }
63
+ }
64
+ ```
65
+
66
+ 然后在页面 wxml 中放置组件,并通过 `component-id` 指定组件 ID(后续 `setIoTPlayer` 绑定时需要用到):
67
+ ``` xml
68
+ <!-- 本端画面预览与推流 -->
69
+ <iot-pusher />
70
+
71
+ <!-- 远端画面与声音渲染 -->
72
+ <iot-player component-id="remotePlayer" />
73
+ ```
74
+
75
+ > **注意:**
76
+ > 即使发起的是音频通话,也需要放置 `iot-player` 组件——通话中远端的声音通过该组件播放。
77
+ >
78
+
79
+ ### 步骤 3:发起通话
80
+
81
+ #### 3.1 获取通话会话
82
+
83
+ 登录成功后,通过 TXIoTEngine.getCallSession 获取通话会话对象:
84
+ ``` javascript
85
+ const callSession = engine.getCallSession();
86
+ ```
87
+
88
+ > **说明:**
89
+ > 未登录或初始化未完成时 `getCallSession` 返回 null,请先确认登录成功后再调用。
90
+ >
91
+
92
+ #### 3.2 监听通话事件
93
+
94
+ 通过 addListener 注册事件回调,只需实现自己关心的回调方法,未实现的方法不会被调用:
95
+ ``` javascript
96
+ callSession.addListener({
97
+ onCallBegin: (mediaType) => {
98
+ // 通话接通
99
+ },
100
+ onCallEnd: (mediaType, reason) => {
101
+ // 通话结束,reason 为结束原因
102
+ },
103
+ onCallRejected: (callUser) => {
104
+ // 对方拒接
105
+ },
106
+ onCallNoResponse: (callUser) => {
107
+ // 对方无应答
108
+ },
109
+ onCallLineBusy: (callUser) => {
110
+ // 对方占线
111
+ },
112
+ onCallUserOffline: (callUser) => {
113
+ // 对方离线
114
+ },
115
+ onCallUserVideoAvailable: (callUser, available) => {
116
+ // 远端视频可用;
117
+ },
118
+ onCallUserAudioAvailable: (callUser, available) => {
119
+ // 远端音频可用性变化
120
+ },
121
+ onError: (code, msg) => {
122
+ // 通话发生错误
123
+ },
124
+ });
125
+ ```
126
+
127
+ #### 3.3 绑定渲染组件
128
+
129
+ 通过 setIoTPlayer 将远端用户与 `iot-player` 组件绑定,SDK 会在该组件上渲染远端用户的音视频。`CallSession.setIoTPlayer` 第二个参数 iotPlayerComponentId 传入 wxml 中 `component-id` 指定的值:
130
+ ``` javascript
131
+ const sdk = requirePlugin('tx-iot-sdk');
132
+
133
+ // 构造对端用户;deviceId 为被叫设备的设备标识(含 productId / deviceName)
134
+ const deviceId = { productId: 'YOUR_PRODUCT_ID', deviceName: 'YOUR_DEVICE_NAME' };
135
+ const callUser = new sdk.TXIoTCallUser(deviceId);
136
+
137
+ // 与 wxml 中的 <iot-player component-id="remotePlayer" /> 绑定
138
+ callSession.setIoTPlayer(callUser, 'remotePlayer');
139
+ callSession.startRemoteView(callUser);
140
+ ```
141
+
142
+ #### 3.4 发起呼叫
143
+
144
+ 调用 callDevice 向设备发起通话,`callType` 指定通话类型:`AUDIO` 音频通话、`VIDEO` 视频通话(见 TXIoTCallMediaType):
145
+ ``` javascript
146
+ // 发起视频通话;音频通话传 sdk.TXIoTCallMediaType.AUDIO
147
+ callSession.callDevice(deviceId, sdk.TXIoTCallMediaType.VIDEO);
148
+ ```
149
+
150
+ 呼叫结果通过 第3.2步 注册的回调通知:接通时收到 `onCallBegin`;对端拒接、无应答、占线、离线时分别收到 `onCallRejected`、`onCallNoResponse`、`onCallLineBusy`、`onCallUserOffline`。
151
+
152
+ #### 3.5 开启本端媒体
153
+
154
+ 通话接通前后,都可以按需开启本端媒体:
155
+ ``` javascript
156
+ // 开启本端麦克风
157
+ callSession.openMicrophone();
158
+
159
+ // 视频通话:开启本端摄像头(前置)
160
+ callSession.openCamera(sdk.TXIoTCamera.FRONT);
161
+ ```
162
+
163
+ #### 3.6 挂断通话
164
+
165
+ 调用 hangup 挂断当前通话。通话结束后收到 `onCallEnd` 回调,`reason` 为结束原因(本端挂断、对端挂断、网络错误等,见 TXIoTCallEndReason):
166
+ ``` typescript
167
+ callSession.hangup();
168
+ ```
169
+
170
+ 完整的通话接口说明(含 `switchCamera` 切换摄像头、`selectAudioPlaybackDevice` 切换扬声器/听筒等)。
171
+
172
+ ## 常见问题
173
+
174
+ ### 通话接通后听不到远端声音?
175
+
176
+ 确认页面已放置 `iot-player` 组件。音频通话场景下远端声音也通过该组件播放,组件缺失会导致无声。
177
+
178
+ ### getCallSession 返回 null?
179
+
180
+ `getCallSession` 依赖 TXIoTEngine 创建与登录完成。请在登录成功的回调之后再获取通话会话对象,并确认 `tx-iot-sdk` 插件已正确集成。
181
+
182
+ ### 呼叫后立即收到对端离线回调?
183
+
184
+ 收到 `onCallUserOffline` 表示设备端不在线。请确认设备已激活 TWeCall 服务并成功登录上线,设备端接入流程。
185
+
186
+ ## 相关文档
187
+ - 设备端接入:设备侧接入流程,含呼叫小程序与接听小程序呼叫。
188
+
189
+ - 设备呼叫小程序:对端方向(设备呼叫微信)的小程序端接入。
190
+
191
+ - TXIoTCallSession:通话接口的完整说明。
192
+
193
+ - TXIoTDeviceManager:设备绑定等接口的完整说明。
@@ -0,0 +1,189 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - android
5
+ types:
6
+ - api
7
+ retrievable_scope: always
8
+ feature_domain: client_api
9
+ ---
10
+
11
+ ## 概述
12
+
13
+ TXIoTCallSession 负责与设备之间的音视频通话,包括发起呼叫、挂断、远端画面渲染、麦克风/摄像头控制及音频输出设备选择。TXIoTCallSession 通过 TXIoTEngine.getCallSession 获取实例,需在登录成功后调用。
14
+
15
+ > **说明:**
16
+ > 回调模型:通话事件通过 `TXIoTCallListener` 接口回调,所有 Listener 回调在主线程触发,公共类型与错误码定义见 TXIoTEngineDef。
17
+ >
18
+
19
+ ## 方法列表
20
+
21
+ |方法签名|描述|
22
+ |---------|---------|
23
+ |addListener|添加通话事件监听器。|
24
+ |removeListener|移除通话事件监听器。|
25
+ |callDevice|向设备发起通话(音频/视频)。|
26
+ |hangup|挂断当前通话。|
27
+ |startRemoteView|开始渲染远端视频。|
28
+ |stopRemoteView|停止渲染远端视频。|
29
+ |openMicrophone|打开麦克风。|
30
+ |closeMicrophone|关闭麦克风。|
31
+ |openCamera|打开摄像头并设置本地预览视图。|
32
+ |closeCamera|关闭摄像头。|
33
+ |switchCamera|切换摄像头(前后置)。|
34
+ |selectAudioPlaybackDevice|选择音频播放设备(扬声器/听筒)。|
35
+
36
+ ### addListener
37
+
38
+ **添加通话事件监听器**
39
+
40
+ |参数|描述|
41
+ |---------|---------|
42
+ |listener|`TXIoTCallListener`;监听器实例。|
43
+
44
+ ### removeListener
45
+
46
+ **移除通话事件监听器**
47
+
48
+ |参数|描述|
49
+ |---------|---------|
50
+ |listener|`TXIoTCallListener`;监听器实例。|
51
+
52
+ ### callDevice
53
+
54
+ **向设备发起通话(音频/视频)**
55
+
56
+ |参数|描述|
57
+ |---------|---------|
58
+ |deviceId|TXIoTDeviceId;设备标识(含 productId / deviceName)。|
59
+ |callType|TXIoTCallMediaType;通话类型(音频/视频)。|
60
+
61
+ ### hangup
62
+
63
+ **挂断当前进行中的通话**
64
+
65
+ ### startRemoteView
66
+
67
+ **开始渲染远端视频**
68
+
69
+ |参数|描述|
70
+ |---------|---------|
71
+ |callUser|TXIoTCallUser;参与通话的用户。|
72
+ |videoView|`TXCloudVideoView`;视频渲染视图。|
73
+
74
+ ### stopRemoteView
75
+
76
+ **停止渲染远端视频**
77
+
78
+ |参数|描述|
79
+ |---------|---------|
80
+ |callUser|TXIoTCallUser;参与通话的用户。|
81
+
82
+ ### openMicrophone
83
+
84
+ **打开麦克风**
85
+
86
+ ### closeMicrophone
87
+
88
+ **关闭麦克风**
89
+
90
+ ### openCamera
91
+
92
+ **打开摄像头并设置本地预览视图**
93
+
94
+ |参数|描述|
95
+ |---------|---------|
96
+ |camera|TXIoTCamera;摄像头(前置/后置)。|
97
+ |videoView|`TXCloudVideoView`;视频渲染视图。|
98
+
99
+ ### closeCamera
100
+
101
+ **关闭摄像头**
102
+
103
+ ### switchCamera
104
+
105
+ **切换摄像头(前后置)**
106
+
107
+ |参数|描述|
108
+ |---------|---------|
109
+ |camera|TXIoTCamera;摄像头(前置/后置)。|
110
+
111
+ ### selectAudioPlaybackDevice
112
+
113
+ **选择音频播放设备(扬声器/听筒)**
114
+
115
+ |参数|描述|
116
+ |---------|---------|
117
+ |device|TXIoTAudioPlaybackDevice;音频播放设备(扬声器/听筒)。|
118
+
119
+ ## 通话事件回调
120
+
121
+ |回调方法|说明|
122
+ |---------|---------|
123
+ |`onError(TXIoTErrorCode code, String msg)`|通话发生错误。|
124
+ |`onCallBegin(TXIoTCallMediaType mediaType)`|通话开始。|
125
+ |`onCallEnd(TXIoTCallMediaType mediaType, TXIoTCallEndReason reason)`|通话结束,携带结束原因。|
126
+ |`onCallRejected(TXIoTCallUser callUser)`|通话被对方拒接。|
127
+ |`onCallNoResponse(TXIoTCallUser callUser)`|对方无应答。|
128
+ |`onCallLineBusy(TXIoTCallUser callUser)`|对方占线。|
129
+ |`onCallUserOffline(TXIoTCallUser callUser)`|对方离线。|
130
+ |`onCallUserAudioAvailable(TXIoTCallUser callUser, boolean available)`|远端用户音频状态发生变化。|
131
+ |`onCallUserVideoAvailable(TXIoTCallUser callUser, boolean available)`|远端用户视频状态发生变化。|
132
+ |`onCallNetworkQualityChanged(TXIoTQuality localQuality, List<TXIoTQuality> remoteQualityList)`|网络质量变化通知。|
133
+
134
+ ## 通话相关数据结构与枚举
135
+
136
+ ### TXIoTCallMediaType
137
+
138
+ |枚举|说明|
139
+ |---------|---------|
140
+ |AUDIO|音频通话。|
141
+ |VIDEO|视频通话。|
142
+
143
+ ### TXIoTCallEndReason
144
+
145
+ |枚举|说明|
146
+ |---------|---------|
147
+ |UNKNOWN|未知原因。|
148
+ |LOCAL_HANGUP|本地挂断。|
149
+ |REMOTE_HANGUP|远端挂断。|
150
+ |CALL_PERMISSION_DENIED|呼叫权限被拒绝。|
151
+ |NETWORK_ERROR|网络错误。|
152
+
153
+ ### TXIoTAudioPlaybackDevice
154
+
155
+ |枚举|说明|
156
+ |---------|---------|
157
+ |SPEAKER_PHONE|扬声器(外放)。|
158
+ |EAR_PIECE|听筒。|
159
+
160
+ ### TXIoTCamera
161
+
162
+ |枚举|说明|
163
+ |---------|---------|
164
+ |FRONT|前置摄像头。|
165
+ |BACK|后置摄像头。|
166
+
167
+ ### TXIoTNetworkQuality
168
+
169
+ |枚举|说明|
170
+ |---------|---------|
171
+ |EXCELLENT|极佳|
172
+ |GOOD|良好|
173
+ |POOR|较差|
174
+ |BAD|差|
175
+ |VERY_BAD|很差|
176
+ |DOWN|网络不可用|
177
+
178
+ ### TXIoTCallUser
179
+
180
+ |字段|说明|
181
+ |---------|---------|
182
+ |deviceId|参与通话的设备 ID。|
183
+
184
+ ### TXIoTQuality
185
+
186
+ |字段|说明|
187
+ |---------|---------|
188
+ |callUser|网络质量对应的通话用户。|
189
+ |quality|网络质量等级。|
@@ -0,0 +1,77 @@
1
+ ---
2
+ product: iot
3
+ framework:
4
+ - android
5
+ types:
6
+ - api
7
+ retrievable_scope: always
8
+ feature_domain: client_api
9
+ ---
10
+
11
+ ## 概述
12
+
13
+ `TXIoTCloudStorage` 是云存功能模块,通过 `TXIoTEngine.getCloudStorage(TXIoTDeviceId)` 获取,提供设备云端录像的日期列表与事件列表查询能力。
14
+
15
+ > **说明:**
16
+ > 线程模型:SDK 接口可在任意线程调用;回调均在主线程(UI 线程)触发,调用方可在回调中直接操作 UI。
17
+ >
18
+
19
+ ## 方法列表
20
+
21
+ |方法签名|描述|
22
+ |---------|---------|
23
+ |`getDayList`|查询指定通道有云端录像的日期列表。|
24
+ |`getEventList`|分页查询指定日期的云存事件列表。|
25
+
26
+ ### getDayList
27
+
28
+ **查询有云端录像的日期列表**
29
+
30
+ |参数|描述|
31
+ |---------|---------|
32
+ |channelId|通道 ID,从 0 开始计数;单通道设备填 0。|
33
+ |timeZone|按天统计录像所用的时区;传 `null` 时使用系统默认时区。|
34
+ |callback|结果回调。`onSuccess` 返回有云端录像的日期字符串列表,格式为`yyyy-MM-dd`(如`2026-08-20`);`onError` 返回错误码与错误描述。|
35
+
36
+ ### getEventList
37
+
38
+ **分页查询指定日期的云存事件列表**
39
+
40
+ |参数|描述|
41
+ |---------|---------|
42
+ |channelId|通道 ID,从 0 开始计数;单通道设备填 0。|
43
+ |timeZone|按天统计事件所用的时区;传 `null` 时使用系统默认时区。|
44
+ |date|要查询的日期,格式为`yyyy-MM-dd`(如`2026-08-20`),通常取自 `getDayList` 的返回结果。|
45
+ |nextPageToken|分页标记。首次查询传空字符串 `""`;翻页时传入上一次回调返回的 `TXIoTPageResult.nextPageToken`。|
46
+ |callback|结果回调。`onSuccess` 返回分页结果,`dataList` 为本页事件列表,`nextPageToken` 为空字符串表示没有更多数据;`onError` 返回错误码与错误描述。|
47
+
48
+ > **注意:**
49
+ > `date` 不能为空字符串,否则回调 `onError` 并返回参数错误。
50
+ >
51
+
52
+ ## 云存相关数据结构
53
+
54
+ ### TXIoTEvent
55
+
56
+ **云存事件,包含事件类型、缩略图、发生时间及关联录像文件**
57
+
58
+ |字段|说明|
59
+ |---------|---------|
60
+ |eventType|事件类型标识,可能为空字符串,调用方可按需过滤。|
61
+ |thumbnailUrl|事件缩略图 URL。|
62
+ |eventTimeMs|事件发生时间,Unix 毫秒级时间戳。|
63
+ |durationMs|事件时长,单位毫秒。|
64
+ |videoFiles|事件关联的录像文件列表,元素类型为 `TXIoTVideoFile`。|
65
+
66
+ ### TXIoTVideoFile
67
+
68
+ **云存录像文件,包含播放地址与云点播(VOD)播放信息**
69
+
70
+ |字段|说明|
71
+ |---------|---------|
72
+ |videoUrl|录像文件播放地址。|
73
+ |vodAppId|云点播应用 ID,用于通过 VOD 播放器播放。|
74
+ |vodFileId|云点播文件 ID,用于通过 VOD 播放器播放。|
75
+ |vodPlaySign|云点播播放签名。|
76
+ |startTimeMs|录像片段起始时间,Unix 毫秒级时间戳。|
77
+ |durationMs|录像片段时长,单位毫秒。|