import { Component , OnInit , Inject } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { DOCUMENT } from '@angular/common' ; import ZoomMtgEmbedded from '@zoomus/websdk/embedded' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' , styleUrls : [ './app.component.css' ] } ) export class AppComponent implements OnInit { signatureEndpoint = '' ; apiKey = '' ; meetingNumber = '123456789' ; role = 0 ; userName = 'Angular' ; userEmail = '' ; passWord = '' ; registrantToken = '' ; client = ZoomMtgEmbedded . createClient ( ) ; constructor ( public httpClient , @ Inject ( DOCUMENT ) document ) { } ngOnInit ( ) { let meetingSDKElement = document . getElementById ( 'meetingSDKElement' ) ; this . client . init ( { debug : true , zoomAppRoot : meetingSDKElement , language : 'en-US' , customize : { meetingInfo : [ 'topic' , 'host' , 'mn' , 'pwd' , 'telPwd' , 'invite' , 'participant' , 'dc' , 'enctype' ] , toolbar : { buttons : [ { text : 'Custom Button' , className : 'CustomButton' , onClick : ( ) => { console . log ( 'custom button' ) ; } } ] } } } ) ; } getSignature ( ) { this . httpClient . post ( this . signatureEndpoint , { meetingNumber : this . meetingNumber , role : this . role } ) . toPromise ( ) . then ( ( data ) => { if ( data . signature ) { console . log ( data . signature ) ; this . startMeeting ( data . signature ) ; } else { console . log ( data ) ; } } ) . catch ( ( error ) => { console . log ( error ) ; } ) ; } startMeeting ( signature ) { this . client . join ( { apiKey : this . apiKey , signature : signature , meetingNumber : this . meetingNumber , password : this . passWord , userName : this . userName , userEmail : this . userEmail , tk : this . registrantToken } ) ; } }