Skip to content

Commit

Permalink
fix(webcams): add fallback labels for devices
Browse files Browse the repository at this point in the history
In cases where fingerprinting protection is so adamant that we can't get
the device labels

Fixes bigbluebutton#9053
  • Loading branch information
prlanzarin committed Jul 1, 2021
1 parent 77d3628 commit d532c64
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ class VideoPreview extends Component {
);
}

getFallbackLabel(webcam, index) {
const { intl } = this.props;
return `${intl.formatMessage(intlMessages.cameraLabel)} ${index}`
}

renderDeviceSelectors() {
const {
intl,
Expand Down Expand Up @@ -510,9 +515,9 @@ class VideoPreview extends Component {
className={styles.select}
onChange={this.handleSelectWebcam}
>
{availableWebcams.map(webcam => (
{availableWebcams.map((webcam, index) => (
<option key={webcam.deviceId} value={webcam.deviceId}>
{webcam.label}
{webcam.label || this.getFallbackLabel(webcam, index)}
</option>
))}
</select>
Expand Down

0 comments on commit d532c64

Please sign in to comment.