import { AudioVideoObserver , MeetingSessionStatus , MeetingSessionStatusCode , VideoTileState , ClientMetricReport , MeetingSessionVideoAvailability } from "amazon-chime-sdk-js" ; class AudioVideoObserverTemplate implements AudioVideoObserver { audioVideoDidStartConnecting ( reconnecting ) { console . log ( `[FlectChimeClient][AudioVideoObserver] session connecting. reconnecting: ${ reconnecting }` ) ; } audioVideoDidStart ( ) { console . log ( "session started" ) ; } audioVideoDidStop ( sessionStatus ) { console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from1 ${ JSON . stringify ( sessionStatus ) }` ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from2 ${ sessionStatus . isFailure ( ) }` ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from3 ${ sessionStatus . isAudioConnectionFailure ( ) }` ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from4 ${ sessionStatus . isTerminal ( ) }` ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from5 ${ sessionStatus . statusCode ( ) }` ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] session stopped from6 ${ sessionStatus . toString ! ( ) }` ) ; if ( sessionStatus . statusCode ( ) === MeetingSessionStatusCode . AudioCallEnded ) { console . log ( `meeting ended` ) ; } } videoTileDidUpdate ( tileState ) { } videoTileWasRemoved ( tileId ) { console . log ( "[FlectChimeClient][AudioVideoObserver] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! tile removed" ) ; } videoAvailabilityDidChange ( availability ) { console . log ( `[FlectChimeClient][AudioVideoObserver] video availability changed: canStartLocalVideo ` , availability ) ; console . log ( `[FlectChimeClient][AudioVideoObserver] video availability changed: canStartLocalVideo  ${ availability . canStartLocalVideo }` ) ; } estimatedDownlinkBandwidthLessThanRequired ( estimatedDownlinkBandwidthKbps , requiredVideoDownlinkBandwidthKbps ) { console . log ( `[FlectChimeClient][AudioVideoObserver] Estimated downlink bandwidth is ${ estimatedDownlinkBandwidthKbps } is less than required bandwidth for video ${ requiredVideoDownlinkBandwidthKbps }` ) ; } metricsDidReceive ( clientMetricReport ) { } connectionDidBecomePoor ( ) { console . log ( "[FlectChimeClient][AudioVideoObserver] connection is poor" ) ; } connectionDidSuggestStopVideo ( ) { console . log ( "[FlectChimeClient][AudioVideoObserver] suggest turning the video off" ) ; } videoSendDidBecomeUnavailable ( ) { console . log ( "[FlectChimeClient][AudioVideoObserver] sending video is not available" ) ; } } export default AudioVideoObserverTemplate ;