ConnectyCube / connectycube-cordova-samples

Cordova code samples for ConnectyCube platform
https://connecycube.com
Apache License 2.0
4 stars 5 forks source link

need detailed explanation of session connections state in the documentation #10

Closed azizcreativitykw closed 3 years ago

azizcreativitykw commented 4 years ago

hi I am working on connect cube js SDK for the past couple of days I am only able to log CONNECTING & CONNECTED status I want to log other statuses so that I can hook my code into it so it's my request to explain each session status in detail like when will it happen

ccvlad commented 4 years ago

Also:

// connecting
ConnectyCube.chat
  .connect(userCredentials)
  .then(() => {
    // connected
  })
  .catch((error) => {
     // failed
  });
azizcreativitykw commented 4 years ago

@ccvlad I think you didn't get my point I mean to say, I want to know about each session states, when will it happen

ConnectyCube.videochat.SessionConnectionState.UNDEFINED ConnectyCube.videochat.SessionConnectionState.CONNECTING ConnectyCube.videochat.SessionConnectionState.CONNECTED ConnectyCube.videochat.SessionConnectionState.FAILED ConnectyCube.videochat.SessionConnectionState.DISCONNECTED ConnectyCube.videochat.SessionConnectionState.CLOSED ConnectyCube.videochat.SessionConnectionState.COMPLETED

ccvlad commented 4 years ago

You should have clarified that this is a video chat...

It is state of the ICE agent of the RTCPeerConnection. You are able to find descriptions of RTCPeerConnection.iceConnectionState here.

azizcreativitykw commented 4 years ago

k but when i listen to onSessionConnectionStateChangedListener i am only getting two status CONNECTING & CONNECTED

ccvlad commented 4 years ago

The SDK has listeners for every case: onCallListener, onAcceptCallListener, onRejectCallListener, onStopCallListener, onUserNotAnswerListener, onRemoteStreamListener, onDevicesChangeListener... This is enough to apply all the necessary logic.

The onSessionConnectionStateChangedListener just retranslates states from RTCPeerConnection.iceConnectionState. The ConnectyCube SDK uses some of this states inside.

Some description what I know: