WebRTC JavaScript Client demo – “No such camera found” / “CameraId is invalid Guid” errors in XProtect 2023 R1 and 2024 R1

Hello,

I am trying to use the WebRTC JavaScript Client demo to connect to camera stream through the Milestone API Gateway.

When I provide the API Gateway URL, DeviceId, and credentials, the demo fails to connect and displays the following errors depending on the version of XProtect:

On Milestone XProtect 2023 R1:

Failed to initiate WebRTC session - Error: No such camera found: 00000000-0000-0000-0000-000000000000

On Milestone XProtect 2024 R1:

Failed to initiate WebRTC session - Error: CameraId is invalid Guid

However, when I test the same setup on Milestone XProtect 2025 R2, the WebRTC session starts successfully and the stream plays as expected.

Steps I followed to confirm the CameraId:

I verified that the camera GUID is correct by following the steps mentioned in the WebRTC JavaScript Client demo’s README:

  1. In the Site Navigation pane, select Servers and then select the recording server.
  2. Select a camera that supports H.264 in the Overview pane.
  3. Open the Info tab in the Properties pane.
  4. Ctrl+Click the video image in the Preview pane.
  • The Camera ID is displayed at the bottom of the Properties pane.

I confirmed that the DeviceId (CameraId) I used in the demo matches the one shown in the Management Client.

Also I have tested with multiple cameras, and same issue occurs in XProtect 2023 R1 and 2024 R1. The CORS configuration is already added and enabled in the API Gateway configuration file. (appsettings.Production.json). Also, I am using REST API signaling for WebRTC (not WebSocket signaling).

Kindly advise if there are any additional configuration steps required in XProtect 2023 R1 or 2024 R1 for the WebRTC JavaScript Client to correctly resolve the CameraId through the API Gateway.

Are you setting DeviceId in your request, rather than CameraId? That isn’t supported in the two versions you are is having trouble with, in those versions you should use CameraId instead. It is very important which one you set in your request.

Note: CameraId will still work in the latest versions, it simply won’t allow you to receive associated audio.

Hi Rie Kiuchi,

Thanks for the clarification.

Could you please clarify how I can differentiate between the DeviceId and CameraId in the Milestone Management Client?

I’m currently taking the ID from the highlighted part of the Milestone Management Client.

What you highlight is the camera, if you go one up you have the (hardware) device, in your case both the device and the camera are named “S4 Lab”.

Hi Bo,

Thank you for your response.

I used the Camera ID (highlighted in the red box on the right side of previously attached screenshot). However, I’m encountering the following issues when testing with the WebRTC JavaScript Client demo:

On Milestone XProtect 2023 R1:

“Failed to initiate WebRTC session - Error: No such camera found: 00000000-0000-0000-0000-000000000000”

On Milestone XProtect 2024 R1:

“Failed to initiate WebRTC session - Error: CameraId is invalid Guid”

In contrast, when testing the same setup on Milestone XProtect 2025 R2, the WebRTC session starts successfully and the stream plays as expected.

Could you please advise on how to resolve this issue?

There was a change.

"CameraId changed to deviceId in WebRTC.

The parameter cameraId has been replaced with the parameter deviceId. The deviceId can be either a cameraId or a microphoneId."

Ref. https://doc.developer.milestonesys.com/mipsdk/?base=gettingstarted%2Fmip2025R2_intro.html&tree=tree_home.html

This unfortunately means that you need to differentiate between 25.2 and older versions.

Hi Bo,

I’ve updated the parameter name from deviceId to cameraId in the initiateWebRTCSession function within the rest.js file. Please see the attached screenshot showing the change I made.

After this update, the issue with the camera GUID has been resolved. However, the WebRTC stream is still failing to start. I have attached the screenshot for reference.

Could you please advise on the next steps to make WebRTC stream work with Milestone XProtect 2023 R1?

There was also a major update to the WebRTC functionality in 23.3

https://doc.developer.milestonesys.com/mipsdk/?base=gettingstarted%2Fmip2023R3_intro.html&tree=tree_home.html

I suggest that you take a peek at the WebRTC sample that was in version 23.1.

When looking at the mipsdk-samples-protocol samples in GitHub, click on “release-milestone” then you see the older versions and can pick XProtect 2023 R1 release.

Hi Bo,

As suggested, I tried using the WebRTC sample from version 23.1, but the WebRTC stream still fails to load.

Please find the attached screenshots for your reference.

We have an idea that the cause might be deducted from the logging, please look into the XProtect API Gateway log. (“[C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) API Gateway\Logs\gateway.log”)

If you don’t see anything directly leading you to a solution please let us see the log.

Hi Bo,

Thank you for your guidance.

I checked the XProtect API Gateway log ([C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) API Gateway\Logs\gateway.log) and found recurring warnings and errors related to CloseVideo and missing sessions.

Please find attached snapshot of the gateway.log

Below are the relevant entries:

2025-10-22 14:41:31.929+03:00 [ 283] WARN - CloseVideo - LivesourceState was in state: Initialized, can only perform CloseVideo while in Running or UpdateToken

2025-10-22 14:41:31.930+03:00 [ 283] ERROR - Failed to find session: 951e033a-74ab-4981-9638-da58c28c2582

I suspect we are revisiting a very old known issue… https://developer.milestonesys.com/s/article/WebRTC-fails-in-Chrome-v-124-troubleshooting-hotfix

Hi Bo,

Could you please help us move forward with this issue?

If the WebRTC JavaScript Client demo is not functioning correctly with older versions like XProtect 2023 R1 or XProtect 2024 R2, could you please advise what is the minimum stable version of XProtect where the WebRTC JavaScript Client demo is confirmed to work as expected.

This information will help us determine the correct installation and testing environment.

Thank you

There is no fix for XProtect 2023 R1 concerning this issue. You can only use 2023R3 with a patch or newer versions. There is no patch for versions older than XProtect 2023 R3**.** It can work in Mozilla Firefox as the issue is in Chromium-based browsers.