Commit 7931e77
committed
android: support chooseAudioRoute() and onAudioDeviceChanged event
** chooseAudioRoute() let user choose their own audio route
param: "EARPIECE", "SPEAKER_PHONE", "WIRED_HEADSET", "BLUETOOTH"
if a audio device is unavailable, it will do nothing.
if success, it will return a promise contains an object like
`onAudioDeviceChanged`'s data below.
** onAudioDeviceChanged Event
Will fire event to JS, indicating current available audio devices.
and current selected audio devices. your UI can display available options
according to these data.
Note for writableArray issue,
`availableAudioDeviceList` is a JSON Array String
so you need to `JSON.parse()` it before you use it as an array object in js
example:
```
{
"availableAudioDeviceList": "[\"EARPIECE\", \"SPEAKER_PHONE\"]",
"selectedAudioDevice": "SPEAKER_PHONE",
}
```1 parent 335540e commit 7931e77
File tree
2 files changed
+42
-1
lines changed- android/src/main/java/com/zxcpoiu/incallmanager
2 files changed
+42
-1
lines changedLines changed: 37 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1468 | 1468 | | |
1469 | 1469 | | |
1470 | 1470 | | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1471 | 1487 | | |
1472 | 1488 | | |
1473 | 1489 | | |
| |||
1644 | 1660 | | |
1645 | 1661 | | |
1646 | 1662 | | |
1647 | | - | |
| 1663 | + | |
| 1664 | + | |
1648 | 1665 | | |
1649 | 1666 | | |
1650 | 1667 | | |
| |||
1870 | 1887 | | |
1871 | 1888 | | |
1872 | 1889 | | |
| 1890 | + | |
1873 | 1891 | | |
1874 | 1892 | | |
1875 | 1893 | | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1876 | 1912 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
0 commit comments