Skip to content

Commit 9697a0c

Browse files
committed
tweak
1 parent cead73c commit 9697a0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/darwin/Classes/FlutterRTCMediaStream.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ - (void)selectAudioOutput:(NSString*)deviceId result:(FlutterResult)result {
876876
}
877877

878878
- (void)triggeriOSAudioRouteSelectionUI:(FlutterResult)result {
879+
#if TARGET_OS_IPHONE
879880
if (@available(iOS 11.0, *)) {
880881
AVRoutePickerView *routePicker = [[AVRoutePickerView alloc] init];
881882
routePicker.frame = CGRectMake(0, 0, 44, 44);
@@ -920,6 +921,12 @@ - (void)triggeriOSAudioRouteSelectionUI:(FlutterResult)result {
920921
message:@"AVRoutePickerView is only available on iOS 11.0 or later"
921922
details:nil]);
922923
}
924+
#else
925+
// macOS doesn't support iOS audio route selection UI
926+
result([FlutterError errorWithCode:@"UnsupportedPlatformError"
927+
message:@"triggeriOSAudioRouteSelectionUI is only supported on iOS"
928+
details:nil]);
929+
#endif
923930
}
924931

925932
- (void)mediaStreamTrackRelease:(RTCMediaStream*)mediaStream track:(RTCMediaStreamTrack*)track {

0 commit comments

Comments
 (0)