I would like to embed the video of an IP camera in a Perspective view. If I navigate to http://<cameraIpAddress>/mjpg/video.mjpg and sign in I can view the stream in the web browser. If I put the same string in the VideoPlayer component (and check the liveFeed property), I can view the stream in a perspective project as long as I’ve already signed into the stream directly in the web browser.
If I open the perspective project in another web browser (eg. Edge), this error message comes up in the developer console:
video.mjpg:1 GET http://10.40.30.100/mjpg/video.mjpg 401 (Unauthorized)
and the component shows Error Loading Media: File Not Valid.
If I navigate directly to http://<cameraIpAddress>/mjpg/video.mjpg and sign in, then go back to the perspective project, the stream works with no error message.
It seems like a lack of authentication is my problem. Is there any way to provide this authentication either through the VideoPlayer component or through a third-party module component?
Further Information:
Out of curiousity, I sent a get request through system.net.httpClient to http://<cameraIpAddress>/mjpg/video.mjpg using this script:
It is going to depend entirely on what camera you are using, but typically the user name and password can be included in the URL.
This is just an example:
Interestingly, http://<user>:<password>@<cameraIP>/mjpg/video.mjpg does correctly authenticate me directly in the browser (Chrome and Edge), but it does not work in a Perspective Client. I don’t get the video.mjpg:1 GET http://10.40.30.100/mjpg/video.mjpg 401 (Unauthorized)
error anymore, but it still doesn’t display anything in the component. There’s also no error message in the gateway logs or the browser developer tools console.
The same results for all the permutations I tried of your URL above.
Does anyone know why the browser and the VideoPlayer component work differently in this case?
Honestly ive struggled with this quite a bit. If you have ssl/tls enabled, it wont work at all due to chromium blocking mixed content. I have used a batch file to run a VLC command that re-streamed the RTSP stream from a camera, then used that URL in the video player component.
I modified the project requirements so I didn't have to deal with this. In my case, no one asked for these features, I was just trying to be extra nice to the operators. Since it was going to be a challenge I put it on the perpetually growing list of "things I'd like to get back to someday."
Hello Team,
I have same issue, when pass Camera URL with or without user, password in web browser it works correctly but in case of perspective session (Video player component) it does not work & getting below error.
Error loading media. File not valid
URL without authentication: http://10.XX.XX.XX/axis-cgi/mjpg/video.cgi
URL with Authentication: http://root:pass@10.XXX.XX.XX/axis-cgi/mjpg/video.cgi
Only one different observation, when pass URL without Username, password in perspective session (video camera component) & separately access URL in different tab of web browser & authenticate with username & password it works in perspective session also. I checked console but didn't get any error.
Please suggest the solution to authenticate URL?