Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

Video Chat

Mohamad Nour Chawich edited this page May 2, 2016 · 3 revisions

WikiAPI ReferenceChatVideo Chat

Twilio offers a WebRTC Video calling service that Shoutit use to connect its users.

Twilio Video Libraries and Quick-start guides

Configurations

Account SID AC72062980c854618cfa7765121af3085d
        | Configuration SID                    | API Key

:---------- | :----------------------------------- | :---------------------------------- Production | VS32da2a0f9dbfe4196f4301331e28bfe7 | SK4717f4a7929e0a0224f120acc6a26f5c Development | VS62cb86639806a479f8637eeb98eb80ff | SK701ec111c6e494e9e0fa964c2999507d Local | VS3536d3b62a808cc5ea7c3bbb235a52f5 | SK44baa4734c015a507afe4e18211aff21

Endpoints

Live Docs URL
Video Auth /twilio/video_auth
Video Identity /twilio/video_identity
Video Call /twilio/video_call

Initiating Twilio Client

Should be initiated only for regular users (not guests) when the app opens.

  1. Request Twilio Access Token using Video Auth endpoint
  2. Initializes Twilio SDK with the access token, Configuration SID and API Key (when necessary)

Make sure the token is not expired by checking returned expires_at property. This helps deciding whether to continue using the token or requesting new one.

Video Calling

  1. Request the identity of the Profile you want to call using Video Identity endpoint
  2. Create Video Conversation
  3. Repeat the following steps 3 times during 30 seconds (1st try, pause few secs, 2nd try, pause, 3rd try, fail)
  • make post request to Video Call endpoint using the other Profile identity
  • invite the other Profile to the Video Conversation
  • ignore bad response from Twilio when it is about other client not available
  • break the loop if there was a different error from Twilio
  • pause few seconds
  1. if there was no answer either by finishing the loop or by an error from Twilio that finished it, Makes post request to Video Call endpoint with other Profile's identity and missed that equals true. This sends a Push notification to the other Profile with a missed video call message.

Clone this wiki locally