@@ -14,6 +14,8 @@ export class CapabilitiesSubscriber {
14
14
private _callIdRef : CallIdRef ;
15
15
private _context : CallContext ;
16
16
private _capabilitiesFeature : CapabilitiesFeature ;
17
+ /* @conditional -compile-remove(media-access) */
18
+ private _capabilitiesInitialized : boolean = false ;
17
19
18
20
constructor ( callIdRef : CallIdRef , context : CallContext , capabilities : CapabilitiesFeature ) {
19
21
this . _callIdRef = callIdRef ;
@@ -38,12 +40,19 @@ export class CapabilitiesSubscriber {
38
40
}
39
41
/* @conditional -compile-remove(media-access) */
40
42
this . setUnmuteMicAndTurnVideoOnNotification ( data ) ;
43
+
44
+ /* @conditional -compile-remove(media-access) */
45
+ this . _capabilitiesInitialized = true ;
41
46
} ;
42
47
43
48
/* @conditional -compile-remove(media-access) */
44
49
private setUnmuteMicAndTurnVideoOnNotification = ( data : CapabilitiesChangeInfo ) : void => {
45
50
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
+ ) {
47
56
const capabilityTurnVideoOnAbsent = this . _context . getState ( ) . latestNotifications . capabilityTurnVideoOnAbsent ;
48
57
if ( capabilityTurnVideoOnAbsent ) {
49
58
this . _context . deleteLatestNotification ( this . _callIdRef . callId , 'capabilityTurnVideoOnAbsent' ) ;
@@ -72,7 +81,11 @@ export class CapabilitiesSubscriber {
72
81
}
73
82
}
74
83
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
+ ) {
76
89
const capabilityUnmuteMicAbsent = this . _context . getState ( ) . latestNotifications . capabilityUnmuteMicAbsent ;
77
90
if ( capabilityUnmuteMicAbsent ) {
78
91
this . _context . deleteLatestNotification ( this . _callIdRef . callId , 'capabilityUnmuteMicAbsent' ) ;
0 commit comments