Device Access
Device access is determined by the API key deviceScope and the local SDK runtime device provider.
Device Scope
deviceScope is the API key device allowlist:
[
{ "vid": 4660, "pid": 22136 }
]If deviceScope is not configured, or is an empty array, device access is unrestricted; the runtime does not filter devices by VID/PID.
When deviceScope is non-empty, the local runtime filters device.list and device.get by the current session auth_context.device_scope. If a device is outside the scope, the runtime returns 1105 DEVICE_NOT_IN_AUTH_SCOPE.
Local Access Flow
- Start the SDK runtime.
- Connect Command WS.
- Call
auth.create_sessionwith the API key. - Call
device.listto see authorized devices. - Call
device.getto read resolutions. - Call
device.opento open the device. - Call
video.startto create a preview stream, orcapture.taketo capture a still image. - Call
device.closewhen done; it also stops the active video stream for that device on the current connection.
Resolution and Pixel Format
device.get returns resolutions, each with width, height, real_width, real_height, fps, pixel_format, and is_default. Current Video WS binary frames use pixel_format=mjpeg; clients should pair each binary frame with the preceding stream.frame_meta text event, decode the binary payload as a JPEG/MJPEG image, and draw the decoded image to Canvas.
Troubleshooting
| Problem | Action |
|---|---|
device.list is empty | Check device connection and provider readiness; if deviceScope is configured, confirm that it includes the device VID/PID. |
device.open says device is outside auth scope | Reissue or rotate an API key with the correct VID/PID in the console. |
| Resolution switch fails | Stop the video stream first, or use video.set_format to update the current stream format. |
| Device remains busy after page exit | Call device.close or disconnect Command WS; the runtime cleans devices opened by the connection when it closes. |