Getting Started
Official Site
Getting Started
Official Site
  • Document description
  • Read before you start

    • Create application
    • Docking mode
    • Account system
    • Resource download
    • Integrate your camera
    • From AppId to cloud live
      • Use for live
      • Build a dashboard
      • Add live video to SaaS
      • Fits your ACL
      • Get your accessToken
  • Light application development guide

  • Mobile application development guide

  • Cloud live development guide

  • Desktop application development guide

  • Third party development guide

  • Message push development guide

  • IoT things data model

  • HTTP interface

  • Reference documents

On this page
Direct Answer
Why it matters
Scenario comparison
When to use each
Minimal server flow
Steps
APIs and related components
Pitfalls

Which API can I use for live camera streaming?

Which API can I use for live camera streaming?

Direct Answer

There is no single live API for every surface. For interactive browser monitoring, use getKitToken with ImouPlayer. For a standard HLS live address, call bindDeviceLive. For RTMP, call createDeviceRtmpLive. Always obtain an administrator accessToken on your server first, then mint the short-lived credential or live URL your client needs.

Why it matters

Teams often search for “the live stream API” and paste the first token they find into a web player. That usually fails: OpenAPI authentication (accessToken) is not the same as the Light App play credential (kitToken), and HLS/RTMP addresses are a different product path than ImouPlayer controls. Choosing the right path early avoids black screens, leaked secrets, and unnecessary protocol adapters.

Live is also a product decision. An ops dashboard needs interactive controls. A partner portal may need a gated HLS link. A media pipeline may need RTMP. Matching the API to the surface keeps engineering and security aligned.

Scenario comparison

Product surfaceAPI / componentTypical useDocs
Web live with preview, talk, PTZ, playback UIgetKitToken + ImouPlayerIn-product monitoring dashboardsJS SDK
Shareable / embeddable HLS URLbindDeviceLiveCustom players, kiosk pages, third-party HLS clientsbindDeviceLive
RTMP pipelinecreateDeviceRtmpLiveEncoders, media servers, RTMP consumerscreateDeviceRtmpLive
Live object lifecycleLive list / status / unbind APIsAudit, recycle, troubleshoot live objectsCustom live broadcast

Cloud live messaging on the platform refers to common protocol families (including HLS / FLV / RTMP depending on the interface and device). Match the exact OpenAPI method to the protocol your client actually consumes. Capability availability depends on device model and subscribed services.

When to use each

Use getKitToken + ImouPlayer when your SaaS or portal needs an interactive monitoring experience in the browser: live preview plus product controls that the Light App player is designed for. Your BFF calls OpenAPI with accessToken, returns only kitToken to the page, and initializes ImouPlayer with that token. This is the default recommendation for in-product web live.

Use bindDeviceLive (HLS) when you need a standard live URL—for a custom HLS player, a temporary share page, or a system that already speaks HLS. Treat the URL as sensitive. Choose quality with streamId: 0 = HD, 1 = SD (recommended default for multi-camera dashboards and most list previews).

Use createDeviceRtmpLive when your media path expects RTMP. This is a protocol choice, not a replacement for ImouPlayer’s interactive UI. If you only need a browser tile with controls, prefer ImouPlayer instead of inventing an RTMP-to-browser stack.

If you are unsure, implement ImouPlayer for the primary SaaS UI first, then add HLS only where a URL-based integration is explicitly required.

Minimal server flow

1. accessToken (server, cached)
2. Authorize user against your SaaS ACL for deviceId / channelId
3a. getKitToken → return kitToken to ImouPlayer
  OR
3b. bindDeviceLive(deviceId, channelId, streamId) → return HLS URL
  OR
3c. createDeviceRtmpLive(...) → return RTMP address
4. Open stream on demand; close / unbind when the session ends

Steps

  1. Create an application and bind cameras on open.imoulife.com. Confirm devices appear to OpenAPI, not only in a consumer account.
  2. Call [accessToken](https://open.imoulife.com/book/http/accessToken.html) from your BFF only. Cache and rotate according to platform behavior.
  3. Decide the client surface: ImouPlayer, HLS, or RTMP. Document the choice in your architecture notes so front-end and backend stay aligned.
  4. Mint the matching credential or live object for that camera/channel after ACL checks.
  5. Pass only the short-lived result to the authenticated client. Log issuance for audit if your product requires it.
  6. Monitor live-view and related quotas in My Resources. Adjust concurrency caps when usage grows.

APIs and related components

RoleName
OpenAPI authaccessToken
Web player credentialgetKitToken
Web playerImouPlayer (Light Application)
HLS livebindDeviceLive
RTMP livecreateDeviceRtmpLive
OverviewVideo Monitoring

Pitfalls

  • **kitToken ≠ accessToken.** Player black screens often come from feeding accessToken into ImouPlayer. kitToken is about 2 hours; cache about 1 hour on the BFF.
  • Never put appSecret or accessToken in the browser. Browser code should receive only play credentials after your ACL gate.
  • Protect live URLs. HLS/RTMP addresses can be viewed by anyone who obtains them—gate issuance behind authenticated backend routes and your product ACL.
  • Prefetching streams is risky. Request sources when the user starts watching; premature fetch can lead to timeout or invalid sources.
  • HD everywhere is expensive. Prefer SD (streamId = 1) for grids; switch to HD (streamId = 0) for a focused tile.
  • Quota. Concurrent live views consume platform resources; design for on-demand slots rather than “open all cameras at login.”
  • Lifecycle. When using cloud live objects, plan how you query status and unbind or recycle them so abandoned URLs do not linger beyond your security policy.
Multi-camera dashboard
Build a dashboard