handleCallInterruptionCallbacks method
Future<void>
handleCallInterruptionCallbacks(
- void onInterruptionStart()?,
- void onInterruptionEnd()?, {
- AndroidInterruptionSource androidInterruptionSource = AndroidInterruptionSource.audioFocusAndTelephony,
- @Deprecated('Audio focus is now handled in a way that does not require this parameter. It will be removed in the next major version.') AndroidAudioAttributesUsageType? androidAudioAttributesUsageType,
- @Deprecated('Audio focus is now handled in a way that does not require this parameter. It will be removed in the next major version.') AndroidAudioAttributesContentType? androidAudioAttributesContentType,
Implementation
Future<void> handleCallInterruptionCallbacks(
void Function()? onInterruptionStart,
void Function()? onInterruptionEnd, {
AndroidInterruptionSource androidInterruptionSource =
AndroidInterruptionSource.audioFocusAndTelephony,
@Deprecated(
'Audio focus is now handled in a way that does not require this parameter. It will be removed in the next major version.')
AndroidAudioAttributesUsageType? androidAudioAttributesUsageType,
@Deprecated(
'Audio focus is now handled in a way that does not require this parameter. It will be removed in the next major version.')
AndroidAudioAttributesContentType? androidAudioAttributesContentType,
}) async {
if (!Platform.isAndroid && !Platform.isIOS) {
throw UnimplementedError(
'handleCallInterruptionCallbacks is only supported on Android and iOS');
}
await WebRTC.invokeMethod(
'handleCallInterruptionCallbacks',
<String, dynamic>{
if (Platform.isAndroid)
'androidInterruptionSource': androidInterruptionSource.name,
},
);
final mediaDeviceNative = mediaDevices as MediaDeviceNative;
mediaDeviceNative.onInterruptionStart = onInterruptionStart;
mediaDeviceNative.onInterruptionEnd = onInterruptionEnd;
}