Skip to content

Instantly share code, notes, and snippets.

@phm200
Created May 30, 2018 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phm200/5757ac4e1adfd7bb2a5301c4138667aa to your computer and use it in GitHub Desktop.
Save phm200/5757ac4e1adfd7bb2a5301c4138667aa to your computer and use it in GitHub Desktop.
Streams PR #61 - Mute Control
Agent.prototype.onMuteToggle = function(f) {
var bus = connect.core.getEventBus();
bus.subscribe(connect.AgentEvents.MUTE_TOGGLE, f);
};
Agent.prototype.mute = function() {
connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,
{
event: connect.EventType.MUTE,
data: {mute: true}
});
};
Agent.prototype.unmute = function() {
connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,
{
event: connect.EventType.MUTE,
data: {mute: false}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment