If I’m right, the URL for the Video Channel is:
String url = "http://localhost:8081/XProtectMobile/Video/" + videoId +"/";
but from here, I’m stuck. I’m not sure how to set the RequestHeader or how to send the request to the Video Channel. I don’t know JS so I don’t really understand the MIP SDK samples
My code so far is as below but it’s a bit of a mess because I was randomly trying out things:
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
int responseCode = con.getResponseCode();
System.out.println("Response Code : " + responseCode);
con.setDoOutput(true);
DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.write(null);
out.close();
Or do I call for a GET request instead?
You want to GET frame, so preferably use GET request.
Hi Captain Kirby,
Generally speaking it shouldn’t matter if you send GET or POST request.
Mobile Server processes both types of requests.
We’ve noticed that in some environments is better to make POST requests in order to bypass possible caching algorithms.
It seems to me that you have to write something as input in order to be valid this POST request. For example one byte.
As you know we do have MIP SDK Mobile (as a separate download). There is a JAVA based SDK in it, which is unfortunately only for Android.
But I think you can use it as a reference. If I remember well code is not obfuscated.
I’ll ask around however if we can extract some code/sample from the Android SDK.
Hello,
It’s better to use POST request, indeed.
Then, assuming you have requested the video in pull mode: after you establish the connection, you should send something (eg the character “1”) followed by two CRLFs
So for example, you can send “1\r\n\r\n”.
The server should respond with a frame.
Hope this helps 
Hi, sorry for the late reply.
I managed to receive some bytes after opening a HTTP connection to the channel. I believe I just need to know how to decode the bytes now.
Thanks so much for all your help 
Hello,
Glad you succeeded!
A frame basically consists of one or several headers, followed by a payload (an image in jpeg format).
It’s documented in here: https://doc.developer.milestonesys.com/mipsdkmobile/reference/protocols/mobile_video.html
and a sample can be found here: https://doc.developer.milestonesys.com/mipsdkmobile/reference/protocols/mobile_decoding.html