import { RecordingCallFeature } from '@azure/communication-calling' ; import { CallContext } from './CallContext' ; import { CallIdRef } from './CallIdRef' ; private export class RecordingSubscriber { private _callIdRef : CallIdRef ; private _context : CallContext ; private _recording : RecordingCallFeature ; constructor ( callIdRef , context , recording ) { this . _callIdRef = callIdRef ; this . _context = context ; this . _recording = recording ; if ( this . _recording . isRecordingActive ) { this . _context . setCallRecordingActive ( this . _callIdRef . callId , this . _recording . isRecordingActive ) ; } this . subscribe ( ) ; } private subscribe = ( ) : void => { this . _recording . on ( 'isRecordingActiveChanged' , this . isAvailableChanged ) ; } ; public unsubscribe = ( ) : void => { this . _recording . off ( 'isRecordingActiveChanged' , this . isAvailableChanged ) ; } ; private isAvailableChanged = ( ) : void => { this . _context . setCallRecordingActive ( this . _callIdRef . callId , this . _recording . isRecordingActive ) ; } ; }