I would like to download the full uncompiled, un-compressed, organized code for the web MIP SDK Mobile 2020 R2 for mobile server.
Hi Mike,
In the MIP SDK Mobile are included MAP fileс for debugging purposes.
I’m not sure we have а practice to provide the “full uncompiled, un-compressed, organized” version of the code.
May I ask you why do you need it ?
Hi, sure. I use vs code on my JS SDK project and during my build process, I uglify, compress and obscure the code in my prod environment. I also make some changes to the Diffie Hellman class that allows me to use c# as a client to encrypt my credentials using the PK before I send it to Milestone’s login method. I also add my own configuration JS settings, the ability to adjust video size, frame rates, compression rates, etc. Having the uncompressed, organized JS SDK makes this process alot easier. I suppose I can use the map files and the JS “maximize” lib to get the organize code, if necessary.
Hi Mike,
I’m not sure I completely understand why you need the particular code of the JS part of the MIP SDK Mobile.
XPMobileSDK.js gives you a “facade” (or we could call it even interface) of what could be used from the SDK without any need to understand the underlying implementation.
For example you can use DH key exchange implementation directly from the SDK, without any need to implement it by yourself.
The good think is that XProtect Web Client uses extensively the SDK (all the communication with the Mobile server goes trough it). Thus making the SDK highly tested and robust.
Of course it doesn’t implement the full 100 % of the Mobile Server protocol, but there is possibility to fire custom commands trough the SDK. And if you need something specific we will be glad to assist you in the implementation.
I am making progress with the 2020 R2 version. I do have an question about when the “sample.js” logic. When it executes this script:
/* SAMPLE.JS
* IF window.CustomElements = false WHAT SCRIPT IS SUPPOSED TO EXECUTE
* AFTERWARDS. IN THIS SCENARIO, THE 'video-stream' ELEMENT ARE PRESENT BUT THEY ARE
* EMPTY.
*/
if (!window.customElements) {
console.log("8");
let script = document.createElement('script');
script.addEventListener('load', startApp);
script.src = 'js/sdk/polyfill-webcomponents-bundle.js';
document.querySelector('head').appendChild(script);
} else {
console.log("9");
startApp();
}
What JS file and function name is supposed to execute afterwards? Currently, there are empty video-stream elements. I appreciate your help!
Mike
Hi Mike,
I suppose you are talking about VideoStream sample.
Code on my side is slightly different than yours. In particular at your line 10:
script.src = 'js/polyfill-webcomponents-bundle.js';
I see you have one additional ‘sdk’ in the script path. After the initial ‘js’.
Anyway it is strange if you are in this particular ‘if’. It should happen only on Legacy Edge browser (and IE, but it is not supported by the latest JS SDK). Or eventually some old version of Safari ?
Anyway ‘polyfill-webcomponents-bundle.js’ file is in the ‘js’ sub-folder placed at the level of ‘sample.js’.