When muting video, return if mute state changed.

This commit is contained in:
Guillaume Beraudo 2011-03-18 10:52:52 +01:00
parent c9e4008c7f
commit bc134cfec9

View file

@ -145,14 +145,19 @@ public class AndroidCameraRecordManager {
}); });
} }
public void setMuted(boolean muteState) { /**
if (muteState == muted) return; * @param muteState
* @return true if mute state changed
*/
public boolean setMuted(boolean muteState) {
if (muteState == muted) return false;
muted = muteState; muted = muteState;
if (muted) { if (muted) {
stopVideoRecording(); stopVideoRecording();
} else { } else {
tryToStartVideoRecording(); tryToStartVideoRecording();
} }
return true;
} }
public boolean toggleMute() { public boolean toggleMute() {
setMuted(!muted); setMuted(!muted);