Skip to content

Commit

Permalink
Revert "Merge pull request #76 from Yeghro/main"
Browse files Browse the repository at this point in the history
This reverts commit c24230c, reversing
changes made to 6d35342.
  • Loading branch information
bitkarrot committed Sep 30, 2024
1 parent c24230c commit 06b34c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 40 deletions.
4 changes: 1 addition & 3 deletions public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -3167,11 +3167,9 @@ function handleSelects() {
isButtonsBarOver = e.currentTarget.checked;
localStorageSettings.keep_buttons_visible = isButtonsBarOver;
lS.setSettings(localStorageSettings);
checkButtonsBar();
const status = isButtonsBarOver ? 'enabled' : 'disabled';
userLog('info', `Buttons always visible ${status}`, 'top-end');
e.target.blur();
};

// audio options
switchAutoGainControl.onchange = (e) => {
localStorageSettings.mic_auto_gain_control = e.currentTarget.checked;
Expand Down
52 changes: 15 additions & 37 deletions public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -7286,45 +7286,23 @@ class RoomClient {
// HANDLE PEER VOLUME
// ###################################################

updateVolume(audioConsumerPlayer, volume) {
console.log('Attempting to set volume:', volume);

if (audioConsumerPlayer.setVolume) {
audioConsumerPlayer.setVolume(volume);
} else if (audioConsumerPlayer.volume !== undefined) {
audioConsumerPlayer.volume = volume;
} else if (audioConsumerPlayer.mediaElement) {
audioConsumerPlayer.mediaElement.volume = volume;
}

// console.log('Current volume:', audioConsumerPlayer.volume);
}

handlePV(uid) {
const words = uid.split('___');
let peer_id = words[1] + '___pVolume';
let audioConsumerId = this.audioConsumers.get(peer_id);
let audioConsumerPlayer = this.getId(audioConsumerId);
let inputPv = this.getId(peer_id);
if (inputPv && audioConsumerPlayer) {
inputPv.style.display = 'inline';
inputPv.value = 100;

const handleVolumeChange = () => {
const volume = inputPv.value / 100;
this.updateVolume(audioConsumerPlayer, volume);
};

// Use both input and change events
inputPv.addEventListener('input', handleVolumeChange);
inputPv.addEventListener('change', handleVolumeChange);

// Initial volume set
handleVolumeChange();
handlePV(uid) {
const words = uid.split('___');
let peer_id = words[1] + '___pVolume';
let audioConsumerId = this.audioConsumers.get(peer_id);
let audioConsumerPlayer = this.getId(audioConsumerId);
let inputPv = this.getId(peer_id);
if (inputPv && audioConsumerPlayer) {
inputPv.style.display = 'inline';
inputPv.value = 100;
// Not work on Mobile?
inputPv.addEventListener('input', () => {
audioConsumerPlayer.volume = inputPv.value / 100;
});
}
}
}

// ####################################################
// ####################################################
// HANDLE DOMINANT SPEAKER
// ###################################################

Expand Down

0 comments on commit 06b34c3

Please sign in to comment.