Commit 53d1158d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

call: stop audio when call finished

Change-Id: Id2b0d55ff49be34ba8cc1f91529a326940d7fb5d
Gitlab: #41
parent 0bb4c682
......@@ -42,5 +42,6 @@
- (void)switchInput:(NSString*)deviceName forCall:(NSString*) callID;
- (void)setEncodingAccelerated:(BOOL)state;
- (BOOL)getEncodingAccelerated;
- (void)stopAudioDevice;
@end
......@@ -262,6 +262,10 @@ static id <VideoAdapterDelegate> _delegate;
DRing::switchInput(std::string([callID UTF8String]), std::string([deviceName UTF8String]));
}
- (void)stopAudioDevice {
DRing::stopAudioDevice();
}
#pragma mark PresenceAdapterDelegate
+ (id <VideoAdapterDelegate>)delegate {
......
......@@ -110,6 +110,7 @@ class CallViewModel: Stateable, ViewModel {
}).map({ [weak self] hide in
if hide {
self?.videoService.setCameraOrientation(orientation: UIDevice.current.orientation, callID: nil)
self?.videoService.stopAudioDevice()
}
return hide
})
......@@ -337,6 +338,7 @@ class CallViewModel: Stateable, ViewModel {
// switch to either spk or headset (if connected) for loud ringtone
// incase we were using rcv during the call
self?.audioService.setToRing()
self?.videoService.stopAudioDevice()
self?.log.info("Call canceled")
}, onError: { [weak self] error in
self?.log.error("Failed to cancel the call")
......
......@@ -528,4 +528,8 @@ extension VideoService: VideoAdapterDelegate {
func supportAVPixelFormat(support: Bool) {
supportAVPixelFormat = support
}
func stopAudioDevice() {
videoAdapter.stopAudioDevice()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment