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
- Create an app and bind the device. Download the Web Video SDK from Downloads.
- Load
imou-player.cssandimou-player.js, and add an empty container element. - Put WasmLib where the site can load it, and set
WasmLibPathwhen you initialize the player. Versions integrated after 2024-12-31 must configure WasmLib. - On the server, call
getKitTokenwith theaccessToken, and pass only thekitTokento the player.tokenis not theaccessToken. - Call
new imouPlayer({...}).type1is live and2is playback. For playback, setrecordTypetocloud,localRecord, ornvrDisk. UsestreamId1for a wall of cameras. - Set
codeto 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.
