fix(ios): [iOS] Video Interrupted on incoming call fix (#2207)

* [iOS] Video Interrupted on incoming call fix

* Update index.d.ts
This commit is contained in:
Sankaran Kaliappan 2019-04-14 17:17:12 +05:30 committed by Sibelius Seraphini
parent e564648b7c
commit 8cc3ca2898
2 changed files with 23 additions and 0 deletions

View File

@ -71,6 +71,10 @@ static NSDictionary *defaultFaceDetectorOptions = nil;
selector:@selector(bridgeDidForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(audioDidInterrupted:)
name:AVAudioSessionInterruptionNotification
object:nil];
self.autoFocus = -1;
}
@ -785,6 +789,24 @@ static NSDictionary *defaultFaceDetectorOptions = nil;
}
}
- (void)audioDidInterrupted:(NSNotification *)notification
{
NSDictionary *userInfo = notification.userInfo;
NSInteger type = [[userInfo valueForKey:AVAudioSessionInterruptionTypeKey] integerValue];
switch (type) {
case AVAudioSessionInterruptionTypeBegan:
[self bridgeDidBackground: notification];
break;
case AVAudioSessionInterruptionTypeEnded:
[self bridgeDidForeground: notification];
break;
default:
break;
}
}
- (void)orientationChanged:(NSNotification *)notification
{
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];

1
types/index.d.ts vendored
View File

@ -297,6 +297,7 @@ interface RecordResponse {
uri: string;
videoOrientation: number;
deviceOrientation: number;
isRecordingInterrupted: boolean;
/** iOS only */
codec: VideoCodec[keyof VideoCodec];
}