Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Assume microphone is available #14710

Merged
merged 2 commits into from
Jun 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/ui-message/client/messageBox/messageBoxAudioMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const recordingRoomId = new ReactiveVar(null);
Template.messageBoxAudioMessage.onCreated(function() {
this.state = new ReactiveVar(null);
this.time = new ReactiveVar('00:00');
this.isMicrophoneDenied = new ReactiveVar(true);
this.isMicrophoneDenied = new ReactiveVar(false);

if (navigator.permissions) {
navigator.permissions.query({ name: 'microphone' })
Expand All @@ -99,8 +99,6 @@ Template.messageBoxAudioMessage.onCreated(function() {
this.isMicrophoneDenied.set(permissionStatus.state === 'denied');
};
});
} else {
this.isMicrophoneDenied.set(false);
}
});

Expand Down Expand Up @@ -152,7 +150,6 @@ Template.messageBoxAudioMessage.events({
recordingRoomId.set(this.rid);
} catch (error) {
instance.state.set(null);
instance.isMicrophoneDenied.set(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if the mic permission was assumed to be granted and it fails when clicked? since this line was removed I assume it will silently fail, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will keep the button, which is useful when the permission is accidentally denied; the next click will retrigger the permission dialog.

}
},

Expand Down