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年前361ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ