瀏覽代碼

fix(ios) fix not showing the CarPlay audio interface

master
Saúl Ibarra Corretgé 3 年之前
父節點
當前提交
3097ac8cc4

+ 4
- 1
ios/sdk/src/AudioMode.m 查看文件

@@ -35,9 +35,10 @@ typedef enum {
35 35
 static NSString * const kDevicesChanged = @"org.jitsi.meet:features/audio-mode#devices-update";
36 36
 
37 37
 // Device types (must match JS and Java)
38
-static NSString * const kDeviceTypeHeadphones = @"HEADPHONES";
39 38
 static NSString * const kDeviceTypeBluetooth  = @"BLUETOOTH";
39
+static NSString * const kDeviceTypeCar        = @"CAR";
40 40
 static NSString * const kDeviceTypeEarpiece   = @"EARPIECE";
41
+static NSString * const kDeviceTypeHeadphones = @"HEADPHONES";
41 42
 static NSString * const kDeviceTypeSpeaker    = @"SPEAKER";
42 43
 static NSString * const kDeviceTypeUnknown    = @"UNKNOWN";
43 44
 
@@ -320,6 +321,8 @@ RCT_EXPORT_METHOD(updateDeviceList) {
320 321
             || [portType isEqualToString:AVAudioSessionPortBluetoothLE]
321 322
             || [portType isEqualToString:AVAudioSessionPortBluetoothA2DP]) {
322 323
         return kDeviceTypeBluetooth;
324
+    } else if ([portType isEqualToString:AVAudioSessionPortCarAudio]) {
325
+        return kDeviceTypeCar; 
323 326
     } else {
324 327
         return kDeviceTypeUnknown;
325 328
     }

+ 1
- 0
lang/main.json 查看文件

@@ -31,6 +31,7 @@
31 31
     },
32 32
     "audioDevices": {
33 33
         "bluetooth": "Bluetooth",
34
+        "car": "Car Audio",
34 35
         "headphones": "Headphones",
35 36
         "none": "No audio devices available",
36 37
         "phone": "Phone",

+ 3
- 0
react/features/base/icons/svg/car.svg 查看文件

@@ -0,0 +1,3 @@
1
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path fill-rule="evenodd" clip-rule="evenodd" d="M8.44701 5H15.553C16.427 5 17.1997 5.56747 17.4613 6.40136L18.2765 9H18H6H5.7235L6.5387 6.40136C6.8003 5.56747 7.57305 5 8.44701 5ZM3.29779 10.0507L4.6304 5.80272C5.15358 4.13493 6.69908 3 8.44701 3H15.553C17.3009 3 18.8464 4.13494 19.3696 5.80272L20.7022 10.0507C21.4999 10.782 22 11.8326 22 13V17V18V21H20V18H4V21H2V18V17V13C2 11.8326 2.50012 10.782 3.29779 10.0507ZM6 11C4.89543 11 4 11.8954 4 13V16H20V13C20 11.8954 19.1046 11 18 11H6ZM9 13.5C9 14.3284 8.32843 15 7.5 15C6.67157 15 6 14.3284 6 13.5C6 12.6716 6.67157 12 7.5 12C8.32843 12 9 12.6716 9 13.5ZM16.5 15C17.3284 15 18 14.3284 18 13.5C18 12.6716 17.3284 12 16.5 12C15.6716 12 15 12.6716 15 13.5C15 14.3284 15.6716 15 16.5 15Z"/>
3
+</svg>

+ 1
- 0
react/features/base/icons/svg/index.js 查看文件

@@ -22,6 +22,7 @@ export { default as IconCameraEmpty } from './camera-empty.svg';
22 22
 export { default as IconCameraEmptyDisabled } from './camera-empty-disabled.svg';
23 23
 export { default as IconCameraRefresh } from './camera-refresh.svg';
24 24
 export { default as IconCancelSelection } from './cancel.svg';
25
+export { default as IconCar } from './car.svg';
25 26
 export { default as IconChat } from './chat.svg';
26 27
 export { default as IconChatSend } from './send.svg';
27 28
 export { default as IconChatUnread } from './chat-unread.svg';

+ 14
- 3
react/features/mobile/audio-mode/components/AudioRoutePickerDialog.js 查看文件

@@ -9,6 +9,7 @@ import { hideDialog, BottomSheet } from '../../../base/dialog';
9 9
 import { translate } from '../../../base/i18n';
10 10
 import {
11 11
     Icon,
12
+    IconCar,
12 13
     IconDeviceBluetooth,
13 14
     IconDeviceEarpiece,
14 15
     IconDeviceHeadphone,
@@ -125,6 +126,11 @@ const deviceInfoMap = {
125 126
         text: 'audioDevices.bluetooth',
126 127
         type: 'BLUETOOTH'
127 128
     },
129
+    CAR: {
130
+        icon: IconCar,
131
+        text: 'audioDevices.car',
132
+        type: 'CAR'
133
+    },
128 134
     EARPIECE: {
129 135
         icon: IconDeviceEarpiece,
130 136
         text: 'audioDevices.phone',
@@ -166,7 +172,7 @@ class AudioRoutePickerDialog extends Component<Props, State> {
166 172
      * @inheritdoc
167 173
      */
168 174
     static getDerivedStateFromProps(props: Props) {
169
-        const { _devices: devices } = props;
175
+        const { _devices: devices, t } = props;
170 176
 
171 177
         if (!devices) {
172 178
             return null;
@@ -183,13 +189,18 @@ class AudioRoutePickerDialog extends Component<Props, State> {
183 189
                 continue;
184 190
             }
185 191
 
186
-            const text = device.type === 'BLUETOOTH' && device.name ? device.name : infoMap.text;
192
+            let text = t(infoMap.text);
193
+
194
+            // iOS provides descriptive names for these, use it.
195
+            if ((device.type === 'BLUETOOTH' || device.type === 'CAR') && device.name) {
196
+                text = device.name;
197
+            }
187 198
 
188 199
             if (infoMap) {
189 200
                 const info = {
190 201
                     ...infoMap,
191 202
                     selected: Boolean(device.selected),
192
-                    text: props.t(text),
203
+                    text,
193 204
                     uid: device.uid
194 205
                 };
195 206
 

Loading…
取消
儲存