@@ -98,8 +98,8 @@ const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev
9898 new Promise < void > ( resolve => {
9999 widgetApi . once ( `action:${ ElementWidgetActions . ClientReady } ` , ev => {
100100 ev . preventDefault ( ) ;
101- widgetApi . transport . reply ( ev . detail , { } ) ;
102101 resolve ( ) ;
102+ widgetApi . transport . reply ( ev . detail , { } ) ;
103103 } ) ;
104104 } ) ,
105105 new Promise < void > ( resolve => {
@@ -145,19 +145,22 @@ const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev
145145
146146 widgetApi . on ( `action:${ ElementWidgetActions . JoinCall } ` ,
147147 ( ev : CustomEvent < IWidgetApiRequest > ) => {
148+ ev . preventDefault ( ) ;
148149 const { audioDevice, videoDevice } = ev . detail . data ;
149150 joinConference ( audioDevice as string | null , videoDevice as string | null ) ;
150151 ack ( ev ) ;
151152 } ,
152153 ) ;
153154 widgetApi . on ( `action:${ ElementWidgetActions . HangupCall } ` ,
154155 ( ev : CustomEvent < IWidgetApiRequest > ) => {
156+ ev . preventDefault ( ) ;
155157 meetApi ?. executeCommand ( 'hangup' ) ;
156158 ack ( ev ) ;
157159 } ,
158160 ) ;
159161 widgetApi . on ( `action:${ ElementWidgetActions . ForceHangupCall } ` ,
160162 ( ev : CustomEvent < IWidgetApiRequest > ) => {
163+ ev . preventDefault ( ) ;
161164 meetApi ?. dispose ( ) ;
162165 notifyHangup ( ) ;
163166 meetApi = null ;
@@ -167,38 +170,43 @@ const ack = (ev: CustomEvent<IWidgetApiRequest>) => widgetApi.transport.reply(ev
167170 ) ;
168171 widgetApi . on ( `action:${ ElementWidgetActions . MuteAudio } ` ,
169172 async ( ev : CustomEvent < IWidgetApiRequest > ) => {
170- ack ( ev ) ;
173+ ev . preventDefault ( ) ;
171174 if ( meetApi && ! await meetApi . isAudioMuted ( ) ) {
172175 meetApi . executeCommand ( 'toggleAudio' ) ;
173176 }
177+ ack ( ev ) ;
174178 } ,
175179 ) ;
176180 widgetApi . on ( `action:${ ElementWidgetActions . UnmuteAudio } ` ,
177181 async ( ev : CustomEvent < IWidgetApiRequest > ) => {
178- ack ( ev ) ;
182+ ev . preventDefault ( ) ;
179183 if ( meetApi && await meetApi . isAudioMuted ( ) ) {
180184 meetApi . executeCommand ( 'toggleAudio' ) ;
181185 }
186+ ack ( ev ) ;
182187 } ,
183188 ) ;
184189 widgetApi . on ( `action:${ ElementWidgetActions . MuteVideo } ` ,
185190 async ( ev : CustomEvent < IWidgetApiRequest > ) => {
186- ack ( ev ) ;
191+ ev . preventDefault ( ) ;
187192 if ( meetApi && ! await meetApi . isVideoMuted ( ) ) {
188193 meetApi . executeCommand ( 'toggleVideo' ) ;
189194 }
195+ ack ( ev ) ;
190196 } ,
191197 ) ;
192198 widgetApi . on ( `action:${ ElementWidgetActions . UnmuteVideo } ` ,
193199 async ( ev : CustomEvent < IWidgetApiRequest > ) => {
194- ack ( ev ) ;
200+ ev . preventDefault ( ) ;
195201 if ( meetApi && await meetApi . isVideoMuted ( ) ) {
196202 meetApi . executeCommand ( 'toggleVideo' ) ;
197203 }
204+ ack ( ev ) ;
198205 } ,
199206 ) ;
200207 widgetApi . on ( `action:${ ElementWidgetActions . StartLiveStream } ` ,
201208 ( ev : CustomEvent < IWidgetApiRequest > ) => {
209+ ev . preventDefault ( ) ;
202210 if ( meetApi ) {
203211 meetApi . executeCommand ( 'startRecording' , {
204212 mode : 'stream' ,
0 commit comments