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년 전366회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠