Skip to content

Commit

Permalink
Warn and disable buttons if WebRTC is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
daradib committed Mar 27, 2024
1 parent d97e9fb commit fb0343e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions phonebank/static/phonebank/phonebank.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,13 @@ function warning(message) {
}

$(document).ready(function () {
$('#echo').attr('disabled', false);
$('#getContact').attr('disabled', false);
const webRTCInfo = TelnyxWebRTC.TelnyxRTC.webRTCInfo();
if (webRTCInfo.supportWebRTC) {
$('#echo').attr('disabled', false);
$('#getContact').attr('disabled', false);
} else {
warning("Your browser does not support making calls.");
}
});

$(document).keydown(function (e) {
Expand Down

0 comments on commit fb0343e

Please sign in to comment.