Jodo WidgetAPI

Author: ritika raj 281 views

Jodo WidgetAPI Quick setup Note

  1. Chat from widget:

jodoChat(”,”,”,”)

Optional Parameters: ‘,”,”

Example: jodoChat(‘english’,”,”,”);

  1. Voice call from Widget

jodoChat(”,”,”,”)

Optional Parameters: ‘,”,”

Example: jodoChat(‘english’,”,”,”);

  1. Video call from Widget

jodoVideo(”,”,”,”)

Optional Parameters: ‘,”,”

Example: jodoVideo(‘english’,”,”,”);

  1. Screenshare call from widget

jodoScreenshare(”,”,”,”)

Optional Parameters: ‘,”,”

Example: jodoScreenshare (‘english’,”,”,”);

  1. Widget Load event and Auto trigger External events:

jodoWidgetInitialized() {

// Please write code to show or enable controls at hosted page.

Example:

try {

    document.getElementById(“startChat”).style.pointerEvents = “none”;

    document.getElementById(“startChat”).style.opacity = “0.4”;

  } catch (e) { }

// Example initialize auto call after 1 second inside jodoWidgetInitialized function.

setTimeout(function () {

document.getElementById(‘startChat’).click();

  }, 1000);

}

  1. External Iframe events:

bindEvent(window, ‘message’, function (e) {

var parentMsg = JSON.parse(e.data);

var status = parentMsg.id;

var message = parentMsg.message;

switch (status) {

case “screenshare”:

if (message === “started”) {

                             // On screenshare started code

}

if (message === “ended”) {

                             // On screenshare ended code

}

break;

case “voice”:

if (message === “answered”) {

                             // On voice call started code

}

if (message === “ended”) {

                             // On voice call ended code

}

break;

case “UaRegistered”:

try {

               // Enable or disable click events on mapped controls after widget load

  document.getElementById(“startChat”).style.pointerEvents = “auto”;

document.getElementById(“startChat”).style.opacity = “unset”;

} catch (e) {

             }

            break;

     }