@@ -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