mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-19 18:36:25 +00:00
Ad timer
This commit is contained in:
parent
06aa2ffa6b
commit
b7d92d285d
3 changed files with 24 additions and 0 deletions
17
index.html
17
index.html
|
@ -8,5 +8,22 @@
|
|||
EJS_gameUrl = 'mega_mountain.nes';
|
||||
EJS_DEBUG_XX = true;
|
||||
EJS_AdUrl = "https://www.google.com/search?igu=1";
|
||||
EJS_Buttons = {
|
||||
playPause: false,
|
||||
restart: false,
|
||||
mute: false,
|
||||
settings: false,
|
||||
fullscreen: true,
|
||||
saveState: false,
|
||||
loadState: false,
|
||||
screenRecord: false,
|
||||
gamepad: false,
|
||||
cheat: false,
|
||||
volume: true,
|
||||
quickSave: false,
|
||||
quickLoad: false,
|
||||
screenshot: false,
|
||||
cacheManager: false
|
||||
}
|
||||
</script>
|
||||
<script src='src/loader.js'></script>
|
||||
|
|
|
@ -225,6 +225,11 @@ class EmulatorJS {
|
|||
|
||||
this.on("start", () => {
|
||||
closeParent.removeAttribute("hidden");
|
||||
const time = (typeof this.config.adTimer === "number" && this.config.adTimer > 0) ? this.config.adTimer : 10000;
|
||||
if (this.config.adTimer === 0) return;
|
||||
setTimeout(() => {
|
||||
div.remove();
|
||||
}, time);
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
config.gameName = window.EJS_gameName;
|
||||
config.color = window.EJS_color;
|
||||
config.adUrl = window.EJS_AdUrl;
|
||||
config.adTimer = window.EJS_AdTimer
|
||||
config.VirtualGamepadSettings = window.EJS_VirtualGamepadSettings;
|
||||
|
||||
new EmulatorJS(EJS_player, config);
|
||||
|
||||
|
|
Loading…
Reference in a new issue