Light-app first preview
Light-app first preview
Use ImouPlayer in Chrome, Firefox, or Edge (55 or later). Full parameters stay on JavaScript development. This page only gets the first frame.
Server: get the token
- Create an app and bind the camera. See Create an app and Add a device.
- On the server, call accessToken.
- Still on the server, call
getKitTokenathttps://openapi-[DataCenter].easy4ip.com/openapi/getKitToken. Protocol: JavaScript development §1.5.
kitToken is valid for 2 hours. Cache it in your service for about one hour. Do not call the platform on every play. Do not compute kitToken in the browser. The player token field is the kitToken, not the accessToken.
For live preview set type to 1. 0 is all permissions, 2 is playback, 6 is PTZ. Pass deviceId and channelId.
ImouPlayer: first frame
- Download Web Video SDK from Downloads.
- Load
imou-player.cssandimou-player.js, and add an empty container. - Integrations started after 2024-12-31 must place WasmLib on a reachable path and set
WasmLibPath. See Integrate the light application. - Give the page only the
kitToken. Callnew imouPlayer({...})withtype1for live. For a wall of cameras usestreamId1. - Set
codeto the decryption secret: custom audio/video key if the device has one; otherwise the device password; otherwise the serial number.
Try the light-application demo before you copy the sample. An init snippet is in Integrate on the web.
Common errors
| Symptom | What to check |
|---|---|
| Player never starts | token is kitToken, not accessToken. WasmLib is configured. |
SN1005 or token errors | Sign and nonce rules in Development specification. Administrator token still valid (3 days, TK1002). |
| No first frame | Device is bound. deviceId / channelId match Paged device detail. Browser is Chrome, Firefox, or Edge ≥ 55. |
| Decrypt failure | code matches the device key rule above. |
More player errors: JavaScript development.
