Файл: voice/js/storage.js
Строк: 21
<?php
export const iconsDefaultSele = (stream) => {
if(localStorage.getItem('voiceAudio') !== null) {
stream.getVideoTracks()[0].enabled = false;
voiceIcons.className = 'fm-voice-microphone'
} else
if(localStorage.getItem('voiceAudio') === null) {
stream.getVideoTracks()[0].enabled = true;
voiceIcons.className = 'fm-voice-camera'
};
document.querySelector('#voiceIcons').addEventListener('click', e => {
if(stream.getVideoTracks()[0].enabled === true) {
stream.getVideoTracks()[0].enabled = false
voiceIcons.className = 'fm-voice-microphone'
localStorage.setItem('voiceAudio', true)
} else
if(stream.getVideoTracks()[0].enabled === false) {
stream.getVideoTracks()[0].enabled = true
voiceIcons.className = 'fm-voice-camera'
localStorage.removeItem('voiceAudio');
};
});
}
?>