Custom default volume

This commit is contained in:
Ethan O'Brien 2023-07-03 09:34:48 -05:00
parent daaf010b94
commit dcd01210a1
3 changed files with 4 additions and 2 deletions

View file

@ -13,5 +13,6 @@
mute: false,
volume: true,
}*/
EJS_volume = 1;
</script>
<script src='src/loader.js'></script>

View file

@ -148,17 +148,17 @@ class EmulatorJS {
}
}
constructor(element, config) {
this.config = config;
window.EJS_TESTING = this;
this.currentPopup = null;
this.touch = false;
this.debug = (window.EJS_DEBUG_XX === true);
this.cheats = [];
this.started = false;
this.volume = 0.5;
this.volume = (typeof this.config.volume === "number") ? this.config.volume : 0.5;
this.muted = false;
this.paused = true;
this.listeners = [];
this.config = config;
this.setElements(element);
this.setColor(this.config.color || "");
if (this.config.adUrl) this.setupAds(this.config.adUrl);

View file

@ -53,6 +53,7 @@
config.adTimer = window.EJS_AdTimer
config.VirtualGamepadSettings = window.EJS_VirtualGamepadSettings;
config.buttonOpts = window.EJS_Buttons;
config.volume = window.EJS_volume;
new EmulatorJS(EJS_player, config);