How to run Web Mobile SDK?

I downloaded the full Web pckg and see there is a XPMobileSDK.js file, but no clear run or activate js class/function.

Can someone provide guidance on how to actually run the Web MobileSDK?

Hi Ethan,

The easiest way is use the SDK directly from the Mobile server installation folder.

During the installation it automatically deploys MIP SDK Mobile for Web.

In mobile server installation folder (ProgramFIles/Milestone Mobile Server) there is “Web” sub-folder. In it is placed “XPMobileSDK” sub-folder.

Mentioned “XPMobileSDK.js” file should persist there.

And there should be “Samples” sub-folder.

you could look at the samples in order to understand how to use the SDK.

videoSample.html placed at “Video” sub-folder is good starting point.

By default samples are “disabled” and Mobile server serves them as downloads.

in order to change this behaviour find corresponding “.download” file in relevant sample sub-folder and rename it.

From now it will be possible to access the samples directly from the browser at the Mobile server address.

For exmaple “http://:/XPMobileSDK/Samples/Video/videoSample.html”.

You could update your hosted Mobile server SDK by replacing files with downloaded one. It worth doing it only if your Mobile server is not the latest one.

If you want you could host the SDK and the samples on separate machine.

In order to do that please follow the steps described here:

https://developer.milestonesys.com/s/article/XProtect-Mobile-Server-app-on-different-server-CORS

Further if you want to use IFrames there is an article how to enable them:

https://developer.milestonesys.com/s/article/Display-video-from-XProtect-Mobile-Server-in-an-iframe

I am on the versions below:

Milestone XProtect Corporate 2018 R3 (12.3a)

Milestone XProtect Web Client 2017 R3 (11.3a)

I can not get either Web/Samples/Video/videoSample1.html (2018R3) or the XPMobileSDK/example.html (2017R3) samples to work. The server connects, the login information validates but no video on either. I tried it on the local server but no luck. I can see the network activity responding but no video. Any help is appreciated.

Thanks

Hi Mike,

As I understand you are running Mobile server 2017 R3 (11.3 a) connected to XProtect Corporate 2018 R3 (12.3 a).

This is actually not officially supported by Milestone.

Why don’t you just upgrade your Mobile server to 2018 R3 (12.3a) ?

It is part of the installation package of the Corporate as well as it could be found in the download manager (“http://<xpco_address>/Installation/Admin/”).

Once you upgrade your Mobile server you will find version of the samples (and web SDK) already installed.

Petar,

I passed this information on to the administrator of the system. But I have one more question. I am creating a custom web app to view video. My app will only display 1 video stream per pop-up page (users can open multiple pop-up pages to view more streams). Previously, I used the active-x imaginviewer component. Which worked good using some javascript inside an MVC app. But I would like to start looking at the mobile server or another solutions that has the ability to be completely hosted in a web app. I can pass the encrypted creds into my app but what solutions does milestone offer for this type of setup? I do not need a template of views or anything like. Is the Mobile SDk the best route?

Thanks

Mike,

Unfortunately Milestone retired ActiveX plug-in without providing any viable replacement.

But I (personally) think the route you’ve chosen is the right one.

Mobile SDK for Web is very easy to use and supports almost everything that Mobile server is capable to offer.

Displaying single stream in pop-up window should be a piece of cake for a skilled Web developer.

Of course there is some learning curve about the SDK, but there are plenty of samples coming with the Mobile server.

And the actual required code is no more than 200 lines for live. More 200 for basic playback support. (Having in mind the size of the simplest sample :slight_smile: )

If you have any problems or questions for the SDK, please ask freely in the forum :slight_smile:

(If I remember well one of our colleagues made similar integration exactly for ActiveX replacement. I’ll ask around if it is not “confidential” and can be used at least for initial reference. It could take a while however as it is a “holidays” season.)

Relevant part of the online documentation could be found at:

https://doc.developer.milestonesys.com/mipsdkmobile/

(click on Web)

Hi Petar, thanks for the thorough answer.

A couple points:

  1. Maybe it’s me but the .zip always extracts with the relative path of the directory in the filename. For example: “Web\Lib\XPMobileSDK.library.js”
  2. When I try running videoSample.html it asks for a Server in an alert window. What am I to put here?

Hi Ethan,

I’ll try to comment your points:

  1. Yep. What is in “MIPSDKMobile_2019R1.zip\Web” folder goes to “ProgramFIles/Milestone Mobile Server/Web/XPMobileSDK” folder.
  2. It could leave it blank if you connect to the same server where the sample is hosted.