16 lines
303 B
JavaScript
16 lines
303 B
JavaScript
'use strict';
|
|
|
|
(function() {
|
|
// Used by PulseAudio, sounds good enough.
|
|
const EXPONENT = 3;
|
|
|
|
Object.defineProperty(HTMLMediaElement.prototype, 'logVolume', {
|
|
get () {
|
|
return this.volume ** (1 / EXPONENT);
|
|
},
|
|
set (originalVolume) {
|
|
this.volume = originalVolume ** EXPONENT;
|
|
}
|
|
});
|
|
})();
|