@@ -357,6 +357,8 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
357
357
startAudioOnly,
358
358
startWithAudioMuted : audioDevice == null ,
359
359
startWithVideoMuted : videoDevice == null ,
360
+ // Request all log levels for inclusion in rageshakes
361
+ apiLogLevels : [ "warn" , "log" , "error" , "info" , "debug" ] ,
360
362
} as any ,
361
363
jwt : jwt ,
362
364
} ;
@@ -411,7 +413,7 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
411
413
412
414
meetApi . on ( "audioMuteStatusChanged" , ( { muted } ) => {
413
415
const action = muted ? ElementWidgetActions . MuteAudio : ElementWidgetActions . UnmuteAudio ;
414
- widgetApi . transport . send ( action , { } ) ;
416
+ widgetApi ? .transport . send ( action , { } ) ;
415
417
} ) ;
416
418
417
419
meetApi . on ( "videoMuteStatusChanged" , ( { muted } ) => {
@@ -421,10 +423,10 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
421
423
// otherwise the React SDK will mistakenly think the user turned off
422
424
// their video by hand
423
425
setTimeout ( ( ) => {
424
- if ( meetApi ) widgetApi . transport . send ( ElementWidgetActions . MuteVideo , { } ) ;
426
+ if ( meetApi ) widgetApi ? .transport . send ( ElementWidgetActions . MuteVideo , { } ) ;
425
427
} , 200 ) ;
426
428
} else {
427
- widgetApi . transport . send ( ElementWidgetActions . UnmuteVideo , { } ) ;
429
+ widgetApi ? .transport . send ( ElementWidgetActions . UnmuteVideo , { } ) ;
428
430
}
429
431
} ) ;
430
432
@@ -435,4 +437,9 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
435
437
} ) ;
436
438
} ) ;
437
439
} ) ;
440
+
441
+ // Patch logs into rageshakes
442
+ meetApi . on ( "log" , ( { logLevel, args } ) =>
443
+ ( parent as unknown as typeof global ) . mx_rage_logger ?. log ( logLevel , ...args ) ,
444
+ ) ;
438
445
}
0 commit comments