Hi, I am using the web sdk in my Angular 7 project and I have an issue like after zoom integration my Apps ngOnInit() method not working (only working on refresh each page). Is there any problem with Zoom in Angular7. I mentioned configuration in the screenshot
class-room.component.ts
import { Component, OnInit, Inject } from ‘@angular/core’;
import { ActivatedRoute } from ‘@angular/router’;
import { HttpErrorResponse } from ‘@angular/common/http’;
import { ClassRoomService } from ‘./class-room.service’;
import { DOCUMENT } from ‘@angular/common’;
import { ZoomMtg } from ‘@zoomus/websdk’;
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
@Component({
selector: ‘app-class-room’,
templateUrl: ‘./class-room.component.html’,
styleUrls: [’./class-room.component.scss’]
})
export class ClassRoomComponent implements OnInit {
signatureEndpoint = ‘http://localhost:4000’
apiKey = ‘’
meetingNumber = 0
role = 0
leaveUrl = ‘’
userName = ‘’
userEmail = ‘’
passWord = ‘’
apiSecretKey = ‘’
studentId = ‘’
studentName = ‘’
constructor(@Inject(DOCUMENT) document,
private classRoomModel: ClassRoomService,
private route: ActivatedRoute,
) {}
ngOnInit() {
this.studentId = this.route.snapshot.params.id;
this.studentName = this.route.snapshot.params.name;
console.log(this.studentId);
this.checkIsActive();
}
checkIsActive() {
document.getElementById('zmmtg-root').style.display = 'none';
this.classRoomModel.getActiveClassOrNot(this.studentId).subscribe(res => {
if(res.success){
this.getConfigaration();
}
});
}
getConfigaration() {
this.classRoomModel.getClassRoomSettings(this.studentId).subscribe(res => {
let flg = 0,error="";
if(res.apiKey){
this.apiKey = res.apiKey;
flg++;
}
if(res.apiSecretKey){
this.apiSecretKey = res.apiSecretKey;
flg++;
}
if(res.username){
this.userName = this.studentName ;//res.username;
flg++;
}
if(res.password){
this.passWord = res.password;
flg++;
}
if(res.mailId){
this.userEmail = res.mailId;
flg++;
}
if(res.meetingNumber){
this.meetingNumber = res.meetingNumber;
flg++;
}
if(flg == 6){
this.openConferencing();
}
});
}
openConferencing() {
var data = {
"meetingNumber":this.meetingNumber,
"role":this.role,
"apiKey":this.apiKey,
"apiSecret":this.apiSecretKey
};
this.classRoomModel.getSignature(data).subscribe(res => {
//getSignature = res.signature;
document.getElementById('zmmtg-root').style.display = 'block'
ZoomMtg.init({
leaveUrl: this.leaveUrl,
isSupportAV: true,
success: (success) => {
console.log(success)
ZoomMtg.join({
signature: res.signature,
meetingNumber: this.meetingNumber,
userName: this.userName,
apiKey: this.apiKey,
userEmail: this.userEmail,
passWord: this.passWord,
success: (success) => {
console.log(success)
},
error: (error) => {
console.log(error)
}
})
},
error: (error) => {
console.log(error)
}
})
}, (err: HttpErrorResponse) => {
console.log(err);
});
};
}