123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /* eslint-disable @typescript-eslint/no-unused-vars */
- import { IState } from '../../app/types';
-
- export * from './functions.any';
-
- /**
- * Returns the deviceId for the currently used camera.
- *
- * @param {Object} state - The state of the application.
- * @returns {void}
- */
- export function getCurrentCameraDeviceId(state: IState) {
- return getDeviceIdByType(state, 'isVideoTrack');
- }
-
- /**
- * Returns the deviceId for the currently used microphone.
- *
- * @param {Object} state - The state of the application.
- * @returns {void}
- */
- export function getCurrentMicDeviceId(state: IState) {
- return getDeviceIdByType(state, 'isAudioTrack');
- }
-
- /**
- * Returns the deviceId for the currently used speaker.
- *
- * @param {Object} state - The state of the application.
- * @returns {void}
- */
- export function getCurrentOutputDeviceId(state: IState) {
- return state['features/base/settings'].audioOutputDeviceId;
- }
-
- /**
- * Returns the deviceId for the corresponding local track type.
- *
- * @param {Object} state - The state of the application.
- * @param {string} isType - Can be 'isVideoTrack' | 'isAudioTrack'.
- * @returns {string}
- */
- function getDeviceIdByType(state: IState, isType: string) {
- const [ deviceId ] = state['features/base/tracks']
- .map(t => t.jitsiTrack)
- .filter(t => t?.isLocal() && t[isType as keyof typeof t]())
- .map(t => t.getDeviceId());
-
- return deviceId || '';
- }
-
- /**
- * Returns the saved display name.
- *
- * @param {Object} state - The state of the application.
- * @returns {string}
- */
- export function getDisplayName(state: IState): string {
- return state['features/base/settings'].displayName || '';
- }
-
-
- /**
- * Handles changes to the `disableCallIntegration` setting.
- * Noop on web.
- *
- * @param {boolean} disabled - Whether call integration is disabled or not.
- * @returns {void}
- */
- // eslint-disable-next-line @typescript-eslint/no-empty-function, require-jsdoc
- export function handleCallIntegrationChange(disabled: boolean) { }
-
- /**
- * Handles changes to the `disableCrashReporting` setting.
- * Noop on web.
- *
- * @param {boolean} disabled - Whether crash reporting is disabled or not.
- * @returns {void}
- */
- // eslint-disable-next-line @typescript-eslint/no-empty-function, require-jsdoc
- export function handleCrashReportingChange(disabled: boolean) { }
|