Webclient SDK Angular Integration

0

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

已提問 2 年前檢視次數 357 次
1 個回答
0

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.

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南