repo: janusweb action: commit revision: path_from: revision_from: 416c7a21c077cc3d17a3d8ae78d33f93b2928bb2: path_to: revision_to:
commit 416c7a21c077cc3d17a3d8ae78d33f93b2928bb2 Author: James BaicoianuDate: Tue Jul 25 15:41:35 2017 -0700 Added 'muted' option to client diff --git a/scripts/client.js b/scripts/client.js
--- a/scripts/client.js
+++ b/scripts/client.js
@@ -64,6 +64,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
networking: args.networking,
autoload: args.autoload,
stats: args.stats,
+ muted: args.muted,
urltemplate: args.urltemplate,
useWebVRPolyfill: args.useWebVRPolyfill,
server: args.server,
@@ -129,6 +130,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
autoload: this.args.autoload,
urltemplate: this.args.urltemplate,
server: this.args.server,
+ muted: this.args.muted,
}
});
this.janusweb = things.children.janusweb;
diff --git a/scripts/janusweb.js b/scripts/janusweb.js
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -66,6 +66,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
server: { type: 'string', default: null },
port: { type: 'integer', default: null },
urltemplate: { type: 'string', default: false },
+ muted: { type: 'boolean', default: false },
});
elation.events.add(window, 'popstate', elation.bind(this, this.handlePopstate));
@@ -87,6 +88,10 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
});
this.engine.systems.controls.activateContext('janus');
+ if (this.muted) {
+ this.mute();
+ }
+
this.network = elation.janusweb.multiplayermanager({
janusweb: this,
server: this.server,
@@ -400,7 +405,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
}
}
this.mute = function(ev) {
- if (ev.value == 1) {
+ if (!ev || ev.value == 1) {
this.engine.systems.sound.toggleMute();
}
}
-----END OF PAGE-----