Compare commits

..

4 Commits

Author SHA1 Message Date
damencho
17e1774f6e Revert "drop: debug."
This reverts commit 7d48ea1bca.
2025-04-29 17:17:53 -05:00
damencho
249bd3a660 Revert "drop: fix build."
This reverts commit 23bba927f3.
2025-04-29 17:17:49 -05:00
damencho
23bba927f3 drop: fix build. 2025-04-29 16:30:31 -05:00
damencho
7d48ea1bca drop: debug. 2025-04-29 14:31:04 -05:00
5 changed files with 22 additions and 10 deletions

View File

@@ -2069,7 +2069,8 @@ export default {
_initDeviceList(setDeviceListChangeHandler = false) {
const { mediaDevices } = JitsiMeetJS;
if (mediaDevices.isDeviceChangeAvailable()) {
if (mediaDevices.isDeviceListAvailable()
&& mediaDevices.isDeviceChangeAvailable()) {
if (setDeviceListChangeHandler) {
this.deviceChangeListener = devices =>
window.setTimeout(() => this._onDeviceListChanged(devices), 0);

View File

@@ -11,6 +11,7 @@ import {
getAvailableDevices,
getCurrentDevices,
isDeviceChangeAvailable,
isDeviceListAvailable,
isMultipleAudioInputSupported,
setAudioInputDevice,
setAudioOutputDevice,
@@ -988,15 +989,10 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
* Returns Promise that resolves with true if the device list is available
* and with false if not.
*
* @deprecated
*
* @returns {Promise}
*/
isDeviceListAvailable() {
console.warn('isDeviceListAvailable is deprecated and will be removed in the future. '
+ 'It always returns true');
return Promise.resolve(true);
return isDeviceListAvailable(this._transport);
}
/**

View File

@@ -56,6 +56,21 @@ export function isDeviceChangeAvailable(transport, deviceType) {
});
}
/**
* Returns Promise that resolves with true if the device list is available
* and with false if not.
*
* @param {Transport} transport - The @code{Transport} instance responsible for
* the external communication.
* @returns {Promise}
*/
export function isDeviceListAvailable(transport) {
return transport.sendRequest({
type: 'devices',
name: 'isDeviceListAvailable'
});
}
/**
* Returns Promise that resolves with true if multiple audio input is supported
* and with false if not.

View File

@@ -150,7 +150,8 @@ export function getAvailableDevices() {
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => new Promise(resolve => {
const { mediaDevices } = JitsiMeetJS;
if (mediaDevices.isDeviceChangeAvailable()) {
if (mediaDevices.isDeviceListAvailable()
&& mediaDevices.isDeviceChangeAvailable()) {
mediaDevices.enumerateDevices((devices: MediaDeviceInfo[]) => {
const { filteredDevices, ignoredDevices } = filterIgnoredDevices(devices);
const oldDevices = flattenAvailableDevices(getState()['features/base/devices'].availableDevices);

View File

@@ -163,8 +163,7 @@ export function processExternalDeviceRequest( // eslint-disable-line max-params
switch (request.name) {
case 'isDeviceListAvailable':
// TODO(saghul): remove this, eventually.
responseCallback(true);
responseCallback(JitsiMeetJS.mediaDevices.isDeviceListAvailable());
break;
case 'isDeviceChangeAvailable':
responseCallback(