Skip to content

Additional Event Documentation #15

Description

@timhuff

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 */) {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions