Skip to content

Commit fd975ce

Browse files
committed
migrated(sqaush)
1 parent d1e60d2 commit fd975ce

File tree

4 files changed

+291
-204
lines changed

4 files changed

+291
-204
lines changed

JitsiMediaDevices.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export default class JitsiMediaDevices extends Listenable {
9595
// We would still want to update the permissions cache in case the permissions API is not supported.
9696
RTC.addListener(
9797
RTCEvents.PERMISSIONS_CHANGED,
98+
// @ts-ignore
9899
permissions => this._handlePermissionsChange(permissions));
99100

100101
// Test if the W3C Permissions API is implemented and the 'camera' and 'microphone' permissions are

modules/RTC/BridgeChannel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import RTCEvents from '../../service/RTC/RTCEvents';
88
import { IReceiverAudioSubscriptionMessage } from '../../service/RTC/ReceiverAudioSubscription';
99
import { SourceName } from '../../service/RTC/SignalingLayer';
1010
import { createBridgeChannelClosedEvent } from '../../service/statistics/AnalyticsEvents';
11-
import ReceiverVideoConstraints from '../qualitycontrol/ReceiveVideoController';
11+
import { IReceiverVideoConstraints } from '../qualitycontrol/ReceiveVideoController';
1212
import Statistics from '../statistics/statistics';
1313

1414

@@ -277,9 +277,9 @@ export default class BridgeChannel {
277277
/**
278278
* Sends a 'ReceiverVideoConstraints' message via the bridge channel.
279279
*
280-
* @param {ReceiverVideoConstraints} constraints video constraints.
280+
* @param {IReceiverVideoConstraints} constraints video constraints.
281281
*/
282-
sendReceiverVideoConstraintsMessage(constraints: ReceiverVideoConstraints): void {
282+
sendReceiverVideoConstraintsMessage(constraints: IReceiverVideoConstraints): void {
283283
logger.info(`Sending ReceiverVideoConstraints with ${JSON.stringify(constraints)}`);
284284
this._send({
285285
colibriClass: 'ReceiverVideoConstraints',

modules/RTC/JitsiLocalTrack.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -554,37 +554,6 @@ export default class JitsiLocalTrack extends JitsiTrack {
554554
});
555555
}
556556

557-
/**
558-
* Sets real device ID by comparing track information with device information. This is temporary solution until
559-
* getConstraints() method will be implemented in browsers.
560-
*
561-
* @param {MediaDeviceInfo[]} devices - The list of devices obtained from enumerateDevices() call.
562-
* @private
563-
* @returns {void}
564-
*/
565-
private _setRealDeviceIdFromDeviceList(devices: MediaDeviceInfo[]): void {
566-
const track = this.getTrack();
567-
const kind = `${track.kind}input`;
568-
569-
// We need to match by deviceId as well, in case of multiple devices with the same label.
570-
let device = devices.find(d => d.kind === kind && d.label === track.label && d.deviceId === this.deviceId);
571-
572-
if (!device && this._realDeviceId === 'default') { // the default device has been changed.
573-
// If the default device was 'A' and the default device is changed to 'B' the label for the track will
574-
// remain 'Default - A' but the label for the device in the device list will be updated to 'A'. That's
575-
// why in order to match it we need to remove the 'Default - ' part.
576-
const label = (track.label || '').replace('Default - ', '');
577-
578-
device = devices.find(d => d.kind === kind && d.label === label);
579-
}
580-
581-
if (device) {
582-
this._realDeviceId = device.deviceId;
583-
} else {
584-
this._realDeviceId = undefined;
585-
}
586-
}
587-
588557
/**
589558
* Starts the effect process and returns the modified stream.
590559
*
@@ -703,6 +672,37 @@ export default class JitsiLocalTrack extends JitsiTrack {
703672
return super.dispose();
704673
}
705674

675+
/**
676+
* Sets real device ID by comparing track information with device information. This is temporary solution until
677+
* getConstraints() method will be implemented in browsers.
678+
*
679+
* @param {MediaDeviceInfo[]} devices - The list of devices obtained from enumerateDevices() call.
680+
* @internal
681+
* @returns {void}
682+
*/
683+
_setRealDeviceIdFromDeviceList(devices: MediaDeviceInfo[]): void {
684+
const track = this.getTrack();
685+
const kind = `${track.kind}input`;
686+
687+
// We need to match by deviceId as well, in case of multiple devices with the same label.
688+
let device = devices.find(d => d.kind === kind && d.label === track.label && d.deviceId === this.deviceId);
689+
690+
if (!device && this._realDeviceId === 'default') { // the default device has been changed.
691+
// If the default device was 'A' and the default device is changed to 'B' the label for the track will
692+
// remain 'Default - A' but the label for the device in the device list will be updated to 'A'. That's
693+
// why in order to match it we need to remove the 'Default - ' part.
694+
const label = (track.label || '').replace('Default - ', '');
695+
696+
device = devices.find(d => d.kind === kind && d.label === label);
697+
}
698+
699+
if (device) {
700+
this._realDeviceId = device.deviceId;
701+
} else {
702+
this._realDeviceId = undefined;
703+
}
704+
}
705+
706706
/**
707707
* Sends mute status for a track to conference if any.
708708
*

0 commit comments

Comments
 (0)