Webclient SDK Angular Integration


I am currently looking to include the NICE DCV Webclient SDK into an angular project but have stumbled onto a problem: With the default setup the following error is displayed in the browser:

DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://<server-url>/recon/dcv/dcvjs/dcv/broadwayh264decoder-worker.js' failed to load.

The same is true for the file lz4decoder-worker.js. It seems that the way angular generates the url-path is causing this problem and is not providing the source files in the location the dcv.js file expects them to be. The html-file that contains the dcv-viewer div component is located at 'https://<server-url>/recon/dcv/' and provided by angular.

It is now working using a workaround. In the dcv.js there is a line where the location of the source files seems to be generated with the baseurl of the site and then appending 'dcvjs':

...?e.baseUrl.replace(/^\/+|\/+$/g,""):"dcvjs",!new RegExp("^http","i")...

Replacing "dcvjs" with the correct url directly ("https://<server-url>/recon/assets/dcvjs"

Using this, the application can now correctly locate the necessary .js files. This is, however, for obvious reasons a rather dirty solution to the problem. We would have to replace the static server-url adress manually for each environment.

So now my question is, is it somehow possible to configure the project in a way where the resources are correctly provided to the application in angular? Further, I have noticed that the sample application of AWS AppStream 2.0 uses NICE DCV in an angular context. Is it possible to provide an angular plugin similar to the react component already included in the SDK?

The perfect solution of course would be to be able to install the SDK using npm :)

Thanks in advance, Julian

asked 2 months ago18 views
1 Answer

Solved: The sdk file location can be manually configured in the connectionConfig when calling connect. This can be done with a relative url as well, so all problems are resolved.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions