I want to check the camera connection and time delay for camera function. I have an IP camera which is run in local network. How can I send a ping to camera and check the camera connection using javascript?
Asked
Active
Viewed 833 times
0
-
You could initiate an AJAX request to access the html interface of the camera (if it has any). Javascript can initiate the request and receive the result and then you could do whatever you want with the data – Ahmad May 10 '17 at 08:44
-
I think that you need something like a proxy to communicate between them if haven't any html interface. But first thing that I would like to ask is if are you using some server or how it working your environment ? Could you explain better your environment ? – Claudio Djohnnatha May 10 '17 at 08:46
-
@ClaudioDjohnnatha My PC connected local network. I'm controlling IP cam in javascript and IP cam also connected same local network. I want to ping to IP cam in javascript and check the cam connected or not. – moguztas May 10 '17 at 09:07
-
@Ahmad is it possible solution without AJAX? I don't know how is AJAX work. – moguztas May 10 '17 at 09:08
-
I think that is necessary a proxy, in case it's better a server. You can create a local server to communicate between each side. If you want use JS for it, you can create a server in nodeJS for solving problem. Your JS cam are just manipulating the client side so you need something to interact with your computer... Ajax is a way to request some data from server, you can check here: https://www.w3schools.com/xml/ajax_intro.asp An ideia is using websocktes, or some api like webrtc – Claudio Djohnnatha May 10 '17 at 09:50