* VRFS-2562, VRFS-2561, VRFS-2560 - fixes for mute state and behavior for voice chat and my tracks
This commit is contained in:
parent
08842ae243
commit
566035348b
|
|
@ -599,6 +599,28 @@
|
|||
return foundMixers;
|
||||
}
|
||||
|
||||
function _getMyVoiceChatMixers() {
|
||||
var mixers = _mixersForGroupId(ChannelGroupIds.AudioInputChatGroup, sessionModel.getMixMode());
|
||||
|
||||
if (mixers.length == 0) { return null; }
|
||||
|
||||
var oppositeMixers = _mixersForGroupId(ChannelGroupIds.AudioInputChatGroup, !sessionModel.getMixMode());
|
||||
|
||||
if(oppositeMixers.length == 0) {
|
||||
logger.warn("unable to find opposite mixer for voice chat");
|
||||
return null;
|
||||
}
|
||||
|
||||
var mixer = mixers[0];
|
||||
var oppositeMixer = oppositeMixers[0];
|
||||
|
||||
return {
|
||||
mixer: mixer,
|
||||
oppositeMixer: oppositeMixer,
|
||||
vuMixer: mixer,
|
||||
muteMixer: mixer
|
||||
}
|
||||
}
|
||||
|
||||
function _clientIdForUserInputMixer(mixerId, mixMode) {
|
||||
var found = null;
|
||||
|
|
@ -745,30 +767,31 @@
|
|||
// If, and only if, there is a mixer in group 3 (voice chat)
|
||||
// Add the voice chat controls below my tracks, and hook up the mixer.
|
||||
// Assumption is that there is only ever one, so we just take the first one.
|
||||
var mixers = sessionModel.isMasterMixMode() ? masterMixers : personalMixers;
|
||||
$.each(mixers, function(index, mixer) {
|
||||
if (mixer.group_id === ChannelGroupIds.AudioInputChatGroup) {
|
||||
var $voiceChat = $('#voice-chat');
|
||||
$voiceChat.show();
|
||||
$voiceChat.attr('mixer-id', mixer.id);
|
||||
var $voiceChatGain = $voiceChat.find('.voicechat-gain');
|
||||
$voiceChatGain.attr('mixer-id', mixer.id);
|
||||
var $voiceChatMute = $voiceChat.find('.voicechat-mute').attr('mixer-id', mixer.id);
|
||||
var gainPercent = percentFromMixerValue(
|
||||
mixer.range_low, mixer.range_high, mixer.volume_left);
|
||||
var faderOpts = {
|
||||
faderId: mixer.id,
|
||||
faderType: "horizontal",
|
||||
width: 50
|
||||
};
|
||||
context.JK.FaderHelpers.renderFader($voiceChatGain, faderOpts);
|
||||
$voiceChatGain.on('fader_change', faderChanged);
|
||||
context.JK.FaderHelpers.setFaderValue(mixer.id, gainPercent);
|
||||
//if (mixer.mute) {
|
||||
_toggleVisualMuteControl($voiceChatMute, mixer.mute);
|
||||
//}
|
||||
}
|
||||
});
|
||||
var voiceChatMixers = _getMyVoiceChatMixers();
|
||||
|
||||
if(voiceChatMixers) {
|
||||
var mixer = voiceChatMixers.mixer;
|
||||
|
||||
var $voiceChat = $('#voice-chat');
|
||||
$voiceChat.show();
|
||||
$voiceChat.attr('mixer-id', mixer.id);
|
||||
var $voiceChatGain = $voiceChat.find('.voicechat-gain');
|
||||
$voiceChatGain.attr('mixer-id', mixer.id);
|
||||
var $voiceChatMute = $voiceChat.find('.voicechat-mute').attr('mixer-id', mixer.id).data('mixer', mixer).data('opposite-mixer', voiceChatMixers.oppositeMixer)
|
||||
var gainPercent = percentFromMixerValue(
|
||||
mixer.range_low, mixer.range_high, mixer.volume_left);
|
||||
var faderOpts = {
|
||||
faderId: mixer.id,
|
||||
faderType: "horizontal",
|
||||
width: 50
|
||||
};
|
||||
context.JK.FaderHelpers.renderFader($voiceChatGain, faderOpts);
|
||||
$voiceChatGain.on('fader_change', faderChanged);
|
||||
context.JK.FaderHelpers.setFaderValue(mixer.id, gainPercent);
|
||||
if (mixer.mute) {
|
||||
_toggleVisualMuteControl($voiceChatMute, mixer.mute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _renderLocalMediaTracks() {
|
||||
|
|
@ -1039,7 +1062,8 @@
|
|||
muteClass: 'muted',
|
||||
mixerId: "",
|
||||
avatarClass: 'avatar-med',
|
||||
preMasteredClass: ""
|
||||
preMasteredClass: "",
|
||||
myTrack: myTrack
|
||||
};
|
||||
|
||||
var mixerData = findMixerForTrack(participant.client_id, track, myTrack)
|
||||
|
|
@ -1306,8 +1330,8 @@
|
|||
// TODO: Use mixer's range
|
||||
var faderValue = percentFromMixerValue(-80, 20, value);
|
||||
context.JK.FaderHelpers.setFaderValue(mixerId, faderValue);
|
||||
//var $muteControl = $('[control="mute"][mixer-id="' + mixerId + '"]');
|
||||
//_toggleVisualMuteControl($muteControl, isMuted);
|
||||
var $muteControl = $('[control="mute"][mixer-id="' + mixerId + '"]');
|
||||
_toggleVisualMuteControl($muteControl, isMuted);
|
||||
}
|
||||
|
||||
function handleBridgeCallback(vuData) {
|
||||
|
|
@ -1442,7 +1466,14 @@
|
|||
var mixer = $control.data('mixer');
|
||||
var oppositeMixer = $control.data('opposite-mixer')
|
||||
|
||||
_toggleAudioMute(mixerId, muting, getMixer(mixerId).mode)
|
||||
if(mixer && oppositeMixer && mixer.group_id == ChannelGroupIds.AudioInputMusicGroup) {
|
||||
// this is the user's local track; mute both personal and master mode
|
||||
_toggleAudioMute(mixer.id, muting, getMixer(mixer.id).mode)
|
||||
_toggleAudioMute(oppositeMixer.id, muting, getMixer(oppositeMixer.id).mode)
|
||||
}
|
||||
else {
|
||||
_toggleAudioMute(mixer.id, muting, getMixer(mixer.id).mode)
|
||||
}
|
||||
|
||||
// look for all controls matching this mixer id (important when it's personal mode + UserMusicInputGroup)
|
||||
var $controls = $screen.find('.track-icon-mute[mixer-id=' + mixerId +']');
|
||||
|
|
@ -1450,8 +1481,20 @@
|
|||
});
|
||||
}
|
||||
else {
|
||||
// this path is taken for voice chat, but maybe others eventually
|
||||
$.each(mixerIds, function(i,v) {
|
||||
_toggleAudioMute(v, muting);
|
||||
var mixerId = v;
|
||||
|
||||
var mixer = $control.data('mixer');
|
||||
var oppositeMixer = $control.data('opposite-mixer')
|
||||
|
||||
if(mixer && oppositeMixer && mixer.group_id == ChannelGroupIds.AudioInputChatGroup) {
|
||||
_toggleAudioMute(mixer.id, muting, mixer.mode);
|
||||
_toggleAudioMute(oppositeMixer.id, muting, oppositeMixer.mode);
|
||||
}
|
||||
else {
|
||||
_toggleAudioMute(mixerId, muting);
|
||||
}
|
||||
});
|
||||
_toggleVisualMuteControl($control, muting);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue