Ionic openvidu deviceid undefined issue

I am trying to integrate openvidu video and audio call based on the demo app with Ionic. But I keep getting the below error in the setup page. Can someone please help in resolving this asap?

ERROR Error: Uncaught (in promise): TypeError: Cannot read property ‘deviceId’ of undefined
TypeError: Cannot read property ‘deviceId’ of undefined
at main.js:1106
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.js:2753)
at Object.onInvoke (vendor.js:59336)
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (polyfills.js:2752)
at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (polyfills.js:2512)
at polyfills.js:3251

Hello @Viswa_TK

Something is wrong in your code.
You are trying to access to a property of a null object.
Check your code out and try to fix it.

Regards

Thanks. It seems to be failing while getting the device list. Please find the code where devices are fetched. Is there any configuration to fetch the device list?

this.OV.getDevices().then((devices: any) => {
this.audioDevices = devices.filter((device) => device.kind === ‘audioinput’);
this.videoDevices = devices.filter((device) => device.kind === ‘videoinput’);