Skip to content

Commit

Permalink
video-preview: 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 are
unable to get device labels and/or IDs

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

Please sign in to comment.