title: Opentok : Can I check if other client is connected to the session?
body: <p>I am using the Opentok library for the video chat.
  There will be 2 clients: one is a servant and another one is a lender.
  I want to disable the lender to access chatting room if the servant is not connected.</p>
  
  <pre><code>startSession(apiKey, sessionId, token) {
      // connect to session
      var self = this;
      self.session = OT.initSession(apiKey, sessionId);
  
      // Subscribe to a newly created stream
      self.session.on("streamCreated", function(event) {
         self.interval = setInterval(self.countTime, 1000);
          self.session.subscribe(
              event.stream,
              "notary-camera",
              {
                  insertMode: "append",
                  width: "100%",
                  height: "100%",
                  showControls: false
              },
              function(error) {
                  if (error) {
                      console.log(error);
                  } else {
                      console.log("Subscriber initialized.");
                  }
              }
          );
      });
  
      // Create a publisher
      self.publisher = OT.initPublisher(
          "client-camera",
          {
              insertMode: "append",
              width: "100%",
              height: "100%",
              showControls: false
          },
          function(error) {
              if (error) {
                  console.log(error);
              } else {
                  console.log("Publisher initialized.");
              }
          }
      );
  
      // Connect to the session
      self.session.connect(token, function(error) {
  
      });
  }
  </code></pre>