Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
    • Quick start
      • Learning paths
      • Console first live view
      • First API call
      • Light-app first preview
      • SDK first preview
      • Create application
    • Account system
    • Docking mode
    • Resource download
  • Concepts
  • Guides
  • Device capabilities & events
  • API reference
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Server: get the token
ImouPlayer: first frame
Common errors

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

  1. Create an app and bind the camera. See Create an app and Add a device.
  2. On the server, call accessToken.
  3. Still on the server, call getKitToken at https://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

  1. Download Web Video SDK from Downloads.
  2. Load imou-player.css and imou-player.js, and add an empty container.
  3. Integrations started after 2024-12-31 must place WasmLib on a reachable path and set WasmLibPath. See Integrate the light application.
  4. Give the page only the kitToken. Call new imouPlayer({...}) with type 1 for live. For a wall of cameras use streamId 1.
  5. Set code to 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

SymptomWhat to check
Player never startstoken is kitToken, not accessToken. WasmLib is configured.
SN1005 or token errorsSign and nonce rules in Development specification. Administrator token still valid (3 days, TK1002).
No first frameDevice is bound. deviceId / channelId match Paged device detail. Browser is Chrome, Firefox, or Edge ≥ 55.
Decrypt failurecode matches the device key rule above.

More player errors: JavaScript development.

First API call
SDK first preview