Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
    • Account and authorization
    • Device access
    • Audio and video
      • Cloud live from an AppId
      • Integrate the light application
      • Build a mobile app
      • Build a desktop app
      • Video playback
      • Troubleshoot preview
    • Device capability integration
    • Receive device messages
    • Manage cloud storage
    • Release and operations
  • Device capabilities & events
  • API reference
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Scope and prerequisites
Steps
Client implementations
Related reference

Integrate the light application

Integrate the light application

Scope and prerequisites

Use a web or mobile browser for live preview, two-way talk, playback, PTZ, snapshot, and screen recording. Streams may be H.264 or H.265, depending on the device. Player parameters are in JavaScript development. This page does not repeat that table.

Supported browsers are Chrome, Firefox, and Edge, version 55 or later.

Steps

  1. Create an app and bind the device. Download the Web Video SDK from Downloads.
  2. Load imou-player.css and imou-player.js, and add an empty container element.
  3. Put WasmLib where the site can load it, and set WasmLibPath when you initialize the player. Versions integrated after 2024-12-31 must configure WasmLib.
  4. On the server, call getKitToken with the accessToken, and pass only the kitToken to the player. token is not the accessToken.
  5. Call new imouPlayer({...}). type 1 is live and 2 is playback. For playback, set recordType to cloud, localRecord, or nvrDisk. Use streamId 1 for a wall of cameras.
  6. Set code to the decryption secret. Use the custom audio and video key when the device has one. If the device only has a device password, use that password. Otherwise use the device serial number.

Try the light-application demo before you build on the sample. An initialization example is in Integrate on the web.

Client implementations

Use templateMode: "pc" for a desktop page and templateMode: "mobile" for a phone browser. Controls, error codes, and the multithreaded response headers are in JavaScript development.

Related reference

  • Integrate on the web
  • JavaScript development
  • Downloads
Cloud live from an AppId
Build a mobile app