Uses the Promise returned on mute/unmute, just prints when calls were canceled due to operation in progress.

This commit is contained in:
damencho 2016-03-08 17:33:09 -06:00
parent 729ca2fbe6
commit 1c3aafd5c4
1 changed files with 20 additions and 4 deletions

View File

@ -88,9 +88,17 @@ function muteLocalAudio (muted) {
} }
if (muted) { if (muted) {
localAudio.mute(); localAudio.mute().then(function(value) {},
function(value) {
console.warn('Audio Mute was rejected:', value);
}
);
} else { } else {
localAudio.unmute(); localAudio.unmute().then(function(value) {},
function(value) {
console.warn('Audio unmute was rejected:', value);
}
);
} }
} }
@ -104,9 +112,17 @@ function muteLocalVideo (muted) {
} }
if (muted) { if (muted) {
localVideo.mute(); localVideo.mute().then(function(value) {},
function(value) {
console.warn('Video mute was rejected:', value);
}
);
} else { } else {
localVideo.unmute(); localVideo.unmute().then(function(value) {},
function(value) {
console.warn('Video unmute was rejected:', value);
}
);
} }
} }