Skip to content

Commit

Permalink
[mirotalkbro] - fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jan 20, 2025
1 parent 49630fa commit 0535d8d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions public/js/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ console.log('Broadcaster', {
viewer: roomURL,
});

const dark = window.localStorage.mode === 'dark';

const body = document.querySelector('body');

const broadcastForm = document.getElementById('broadcastForm');
Expand Down Expand Up @@ -101,6 +99,14 @@ function onBodyLoad() {
toggleSettings();
}

// =====================================================
// Handle theme
// =====================================================

const getMode = window.localStorage.mode || 'dark';
const dark = getMode === 'dark';
if (dark) body.classList.toggle('dark');

// =====================================================
// Handle ToolTips
// =====================================================
Expand Down Expand Up @@ -325,13 +331,6 @@ function sendToViewersDataChannel(method, action = {}, peerId = '*') {
}
}

// =====================================================
// Handle theme
// =====================================================

const getMode = window.localStorage.mode || 'dark';
if (getMode === 'dark') body.classList.toggle('dark');

// =====================================================
// Handle element display
// =====================================================
Expand Down Expand Up @@ -476,7 +475,7 @@ function toggleAudio(enable) {
videoBtn.addEventListener('click', toggleVideo);

function toggleVideo() {
const color = getMode === 'dark' ? 'white' : 'black';
const color = dark ? 'white' : 'black';
videoBtn.style.color = videoBtn.style.color == 'red' ? color : 'red';
videoOff.style.visibility = videoBtn.style.color == 'red' ? 'visible' : 'hidden';
broadcastStream.getVideoTracks()[0].enabled = !broadcastStream.getVideoTracks()[0].enabled;
Expand Down Expand Up @@ -1032,7 +1031,7 @@ function getStream() {
? localStorage.videoQualitySelectedIndex
: 0;
videoFpsSelect.selectedIndex = localStorage.videoFpsSelectedIndex ? localStorage.videoFpsSelectedIndex : 0;
videoBtn.style.color = getMode === 'dark' ? 'white' : 'black';
videoBtn.style.color = dark ? 'white' : 'black';

const audioSource = audioSelect.value;
const videoSource = videoSelect.value;
Expand Down

0 comments on commit 0535d8d

Please sign in to comment.