Skip to content

Commit

Permalink
fix(webcams): add fallback labels for devices in video-preview
Browse files Browse the repository at this point in the history
In cases where fingerprinting protection is so adamant that we are
unable to get device labels

Fixes bigbluebutton#9053
  • Loading branch information
prlanzarin committed Jul 2, 2021
1 parent 24e479e commit 493f1b7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,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 @@ -491,9 +496,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 493f1b7

Please sign in to comment.