I am trying to integrate Video SDK UI Toolkit v 1.12.1-1 in my project but it failed to load Video Components displaying error shown below when calling function
uitoolkit.joinSession(this.sessionContainer, this.videoConfig)
app.component.ts:84 TypeError: Cannot read properties of undefined (reading ‘deviceId’)
at videosdk-ui-toolkit.js:3:784163
at _ZoneDelegate.invoke (zone.js:369:28)
at Object.onInvoke (videosdk-ui-toolkit.js:3:45153)
at _ZoneDelegate.invoke (zone.js:368:34)
at _ZoneImpl.run (zone.js:111:43)
at zone.js:2538:40
at _ZoneDelegate.invokeTask (zone.js:402:33)
at Object.onInvokeTask (videosdk-ui-toolkit.js:3:44969)
at _ZoneDelegate.invokeTask (zone.js:401:38)
at _ZoneImpl.runTask (zone.js:159:47)
(anonymous) @ videosdk-ui-toolkit.js:3
invoke @ zone.js:369
onInvoke @ videosdk-ui-toolkit.js:3
invoke @ zone.js:368
run @ zone.js:111
Here is my sample code
Configuration object
videoConfig: any = {
videoSDKJWT: '',
sessionName: 'SessionA',
userName: 'UserA',
sessionPasscode: 'abc123',
features: ['preview', 'video', 'audio', 'share', 'chat', 'users', 'settings']
}
// Signature Generator
const iat = abc.KJUR.jws.IntDate.get('now'); // Math.floor(Date.now() / 1000)
const exp = iat + 3600
const header = {alg: 'HS256', typ: 'JWT'};
const oPayload = {
appKey: this.sdkKey,
tpc: this.videoConfig.sessionName,
session_key: this.videoConfig.sessionPasscode,
version: 1,
role_type: 1,
iat: iat,
exp: exp,
}
const signature = abc.KJUR.jws.JWS.sign('HS256', JSON.stringify(header), JSON.stringify(oPayload), this.sdkSecret);
this.videoConfig.videoSDKJWT = signature
Code that I executed while joining session
this.sessionContainer = document.getElementById('sessionContainer')
uitoolkit.joinSession(this.sessionContainer, this.videoConfig)
I also tried the following code but displaying blank screen, no error nothing shown
this.sessionContainer = document.getElementById('sessionContainer')
var chatContainer = document.getElementById('chatContainer')
var videoContainer = document.getElementById('videoContainer')
var controlsContainer = document.getElementById('controlsContainer')
uitoolkit.showUitoolkitComponents(this.sessionContainer, this.videoConfig)
uitoolkit.showChatComponent(chatContainer)
uitoolkit.showVideoComponent(videoContainer)
uitoolkit.showControlsComponent(controlsContainer)
Can someone help where I am making mistake.