Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Event Documentation #15

Open
timhuff opened this issue Oct 7, 2017 · 1 comment
Open

Additional Event Documentation #15

timhuff opened this issue Oct 7, 2017 · 1 comment

Comments

@timhuff
Copy link
Contributor

timhuff commented Oct 7, 2017

For the project I'm working on, I wanted to know, in plain english and at a glance, what each event indicates. I wrote handlers for each event (except signaling) and then went through the OpenTok documentation and copied what I felt were the significant parts into comments above each one. I'm a bit busy at the moment, so I don't have time to add it to the README.md but I figured I'd put it here for others' consideration.

  /* Session Event Handlers */

  // This event happens when this client's session has connected to OpenTok
  onSessionDidConnect (/* sessionId */) {}

  // The client has disconnected from the session. This event may be dispatched asynchronously
  // in response to a successful call to the disconnect() method of the Session object. The
  // event may also be disptached if a session connection is lost inadvertantly, as in the
  // case of a lost network connection.
  onSessionDidDisconnect (/* sessionId */) {}

  // Dispatched when a new client (including your own) has connected to the session, 
  // and for every client in the session when you first connect.
  onSessionConnectionCreated (/* connectionId */) { }
  
  // A client, other than your own, has disconnected from the session.
  onSessionConnectionDestroyed (/* connectionId */) {}

  // A new stream, published by another client, has been created on this session.
  onSessionStreamCreated (/* streamId */) {}
  
  // Sent if the attempt to connect to the session fails or if the connection to the session
  // drops due to an error after a successful connection.
  onSessionStreamDidFailWithError (/* err */) {}

  // A stream from another client has stopped publishing to the session.
  onSessionStreamDestroyed (/* streamId */) {}

  /* Publisher Event Handlers */

  // The publisher has started streaming to the session.
  onPublisherStreamCreated (/* streamId */) {}

  // Sent if the publisher encounters an error. After this message is sent,
  // the publisher can be considered fully detached from a session and may be released.
  onPublisherStreamDidFailWithError (/* err */) {}

  // Sent when the publisher stops streaming.
  onPublisherStreamDestroyed (/* streamId */) {}

  /* Subscriber Event Handlers */

  // Sent when the subscriber successfully connects to the stream.
  onSubscriberDidConnect (/* streamId */) {}

  // Sent if the subscriber fails to connect to its stream.
  onSubscriberDidFailWithError (/* streamId */) {}

  // Called when the subscriber’s stream has been interrupted.
  onSubscriberDidDisconnect (/* streamId */) {}
@Jonovono
Copy link
Contributor

Amazing, i'll add this to the documentation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants