mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(external_api,devices) drop use of isDeviceListAvailable
It's always true.
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
a07a1cfe93
commit
ee3f82bf0c
@@ -2069,8 +2069,7 @@ export default {
|
||||
_initDeviceList(setDeviceListChangeHandler = false) {
|
||||
const { mediaDevices } = JitsiMeetJS;
|
||||
|
||||
if (mediaDevices.isDeviceListAvailable()
|
||||
&& mediaDevices.isDeviceChangeAvailable()) {
|
||||
if (mediaDevices.isDeviceChangeAvailable()) {
|
||||
if (setDeviceListChangeHandler) {
|
||||
this.deviceChangeListener = devices =>
|
||||
window.setTimeout(() => this._onDeviceListChanged(devices), 0);
|
||||
|
||||
8
modules/API/external/external_api.js
vendored
8
modules/API/external/external_api.js
vendored
@@ -11,7 +11,6 @@ import {
|
||||
getAvailableDevices,
|
||||
getCurrentDevices,
|
||||
isDeviceChangeAvailable,
|
||||
isDeviceListAvailable,
|
||||
isMultipleAudioInputSupported,
|
||||
setAudioInputDevice,
|
||||
setAudioOutputDevice,
|
||||
@@ -989,10 +988,15 @@ 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() {
|
||||
return isDeviceListAvailable(this._transport);
|
||||
console.warn('isDeviceListAvailable is deprecated and will be removed in the future. '
|
||||
+ 'It always returns true');
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
15
modules/API/external/functions.js
vendored
15
modules/API/external/functions.js
vendored
@@ -56,21 +56,6 @@ 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.
|
||||
|
||||
@@ -150,8 +150,7 @@ export function getAvailableDevices() {
|
||||
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => new Promise(resolve => {
|
||||
const { mediaDevices } = JitsiMeetJS;
|
||||
|
||||
if (mediaDevices.isDeviceListAvailable()
|
||||
&& mediaDevices.isDeviceChangeAvailable()) {
|
||||
if (mediaDevices.isDeviceChangeAvailable()) {
|
||||
mediaDevices.enumerateDevices((devices: MediaDeviceInfo[]) => {
|
||||
const { filteredDevices, ignoredDevices } = filterIgnoredDevices(devices);
|
||||
const oldDevices = flattenAvailableDevices(getState()['features/base/devices'].availableDevices);
|
||||
|
||||
@@ -163,7 +163,8 @@ export function processExternalDeviceRequest( // eslint-disable-line max-params
|
||||
|
||||
switch (request.name) {
|
||||
case 'isDeviceListAvailable':
|
||||
responseCallback(JitsiMeetJS.mediaDevices.isDeviceListAvailable());
|
||||
// TODO(saghul): remove this, eventually.
|
||||
responseCallback(true);
|
||||
break;
|
||||
case 'isDeviceChangeAvailable':
|
||||
responseCallback(
|
||||
|
||||
Reference in New Issue
Block a user