@@ -14,6 +14,8 @@ export class CapabilitiesSubscriber {
1414 private _callIdRef : CallIdRef ;
1515 private _context : CallContext ;
1616 private _capabilitiesFeature : CapabilitiesFeature ;
17+ /* @conditional -compile-remove(media-access) */
18+ private _capabilitiesInitialized : boolean = false ;
1719
1820 constructor ( callIdRef : CallIdRef , context : CallContext , capabilities : CapabilitiesFeature ) {
1921 this . _callIdRef = callIdRef ;
@@ -38,12 +40,19 @@ export class CapabilitiesSubscriber {
3840 }
3941 /* @conditional -compile-remove(media-access) */
4042 this . setUnmuteMicAndTurnVideoOnNotification ( data ) ;
43+
44+ /* @conditional -compile-remove(media-access) */
45+ this . _capabilitiesInitialized = true ;
4146 } ;
4247
4348 /* @conditional -compile-remove(media-access) */
4449 private setUnmuteMicAndTurnVideoOnNotification = ( data : CapabilitiesChangeInfo ) : void => {
4550 if ( data . oldValue . turnVideoOn ?. isPresent !== data . newValue . turnVideoOn ?. isPresent ) {
46- if ( data . oldValue . turnVideoOn ?. isPresent === false && data . newValue . turnVideoOn ?. isPresent ) {
51+ if (
52+ data . oldValue . turnVideoOn ?. isPresent === false &&
53+ data . newValue . turnVideoOn ?. isPresent &&
54+ this . _capabilitiesInitialized
55+ ) {
4756 const capabilityTurnVideoOnAbsent = this . _context . getState ( ) . latestNotifications . capabilityTurnVideoOnAbsent ;
4857 if ( capabilityTurnVideoOnAbsent ) {
4958 this . _context . deleteLatestNotification ( this . _callIdRef . callId , 'capabilityTurnVideoOnAbsent' ) ;
@@ -72,7 +81,11 @@ export class CapabilitiesSubscriber {
7281 }
7382 }
7483 if ( data . oldValue . unmuteMic ?. isPresent !== data . newValue . unmuteMic ?. isPresent ) {
75- if ( data . oldValue . unmuteMic ?. isPresent === false && data . newValue . unmuteMic ?. isPresent ) {
84+ if (
85+ data . oldValue . unmuteMic ?. isPresent === false &&
86+ data . newValue . unmuteMic ?. isPresent &&
87+ this . _capabilitiesInitialized
88+ ) {
7689 const capabilityUnmuteMicAbsent = this . _context . getState ( ) . latestNotifications . capabilityUnmuteMicAbsent ;
7790 if ( capabilityUnmuteMicAbsent ) {
7891 this . _context . deleteLatestNotification ( this . _callIdRef . callId , 'capabilityUnmuteMicAbsent' ) ;
0 commit comments