Fix brightness indicator

This commit is contained in:
Dmitry Lyzo 2020-03-07 17:23:31 +03:00
parent 9bf8731a59
commit dcaa87e4cb

View File

@ -98,15 +98,22 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
}
}
function setIcon(iconElement, icon) {
iconElement.classList.remove('brightness_high');
iconElement.classList.remove('brightness_medium');
iconElement.classList.remove('brightness_low');
iconElement.classList.add(icon);
}
function updateElementsFromPlayer(brightness) {
if (iconElement) {
if (brightness >= 80) {
iconElement.innerHTML = '';
setIcon(iconElement, 'brightness_high');
} else if (brightness >= 20) {
iconElement.innerHTML = '';
setIcon(iconElement, 'brightness_medium');
} else {
iconElement.innerHTML = '';
setIcon(iconElement, 'brightness_low');
}
}
if (progressElement) {