Created
May 30, 2018 19:54
-
-
Save phm200/f05cb64a1655de12d5fd5b71c2dcff56 to your computer and use it in GitHub Desktop.
Streams PR #64 - Application Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// api.js | |
Contact.prototype.onSession = function(f) { | |
var bus = connect.core.getEventBus(); | |
bus.subscribe(this.getEventName(connect.ContactEvents.SESSION), f); | |
}; | |
... | |
// application code | |
function subscribeToContactEvents(contact) { | |
... | |
contact.onSession(handleContactSession); | |
} | |
function handleContactSession(session) { | |
var rtcSession = session; | |
// do something with the RTCSession | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment