Jodo WidgetAPI Quick setup Note
Chat from widget:
jodoChat(”,”,”,”)
Optional Parameters: ‘,”,”
Example: jodoChat(‘english’,”,”,”);
Voice call from Widget
jodoChat(”,”,”,”)
Optional Parameters: ‘,”,”
Example: jodoChat(‘english’,”,”,”);
Video call from Widget
jodoVideo(”,”,”,”)
Optional Parameters: ‘,”,”
Example: jodoVideo(‘english’,”,”,”);
Screenshare call from widget
jodoScreenshare(”,”,”,”)
Optional Parameters: ‘,”,”
Example: jodoScreenshare (‘english’,”,”,”);
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);
}
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;
}