podchat-video-call-sandbox
v1.2.8
Published
component for make or receive call in podchat
Downloads
5
Readme
javascript component for podchat video call
import reference
import VideoCall from 'podchat-video-call-sandbox';
how to use
import * as PodChat from 'podchat-browser';
var params = {
appId: "appId",
/**
* Sand Box
*/
socketAddress: "wss://chat-sandbox.pod.ir/ws",
ssoHost: "https://accounts.pod.ir",
platformHost: "https://sandbox.pod.ir:8043/srv/basic-platform",
fileServer: 'https://core.pod.ir',
podSpaceFileServer: 'https://podspace.pod.ir',
serverName: "chat-server",
token: 'token',// pod token
grantDeviceIdFromSSO: false,
enableCache: false,
fullResponseObject: true,
typeCode: "default",
wsConnectionWaitTime: 500,
connectionRetryInterval: 5000,
connectionCheckTimeout: 10000,
messageTtl: 24 * 60 * 60,
reconnectOnClose: true,
httpRequestTimeout: 30000,
httpUploadRequestTimeout: 0,
forceWaitQueueInMemory: true,
asyncRequestTimeout: 20000,
callOptions: {
callSocketAddress: "wss://46.32.6.187",
callTurnIp: "46.32.6.188",
callDivId: "call-div",
callAudioTagClassName: "podcall-audio",
callVideoTagClassName: "podcall-video"
},
asyncLogging: {
onFunction: true,
consoleLogging: true,
onMessageReceive: false,
onMessageSend: false,
actualTiming: false
}
};
this.chatAgent = new PodChat(params);
this.chatAgent.on("chatReady", () => {
console.log("ready");
initVideoComponent();
});
this.chatAgent.on("error", (err) => {
console.error(err);
});
function initVideoComponent(){
let videoCall = new VideoCall(
'call-container', // HTML element ID that you want to load video
component on it.
{
chatAgent: chatAgent // ChatAgent that is created using podchat SDK
endCallback: endCall // this event will raise when video call is ended
});
videoCall.render();
}
function endCall(){
}