更新時間:2019-11-19
用戶加入會議,包括創(chuàng)建并加入立即會議,加入匿名會議,接受或拒絕會議邀請。
加入會議的前提是已完成登錄和鑒權(quán)。
a1. 構(gòu)建數(shù)據(jù)結(jié)構(gòu)joinConfParam。
a2. 調(diào)用client.joinConference()接口加入會議,a1中的joinConfParam作為參數(shù)。
代碼示例:
var conferenceId = document.getElementById("conferenceId").value; var accessNumber = document.getElementById("accessNumber").value; var confPasswd = document.getElementById("confPasswd").value; var joinConfParam = { conferenceId: conferenceId, accessNumber: accessNumber, confPasswd: confPasswd } client.joinConference(joinConfParam, function callback(evt) { var conference = evt.info; }); |
參考文件:\usage\components\conf_list.html。
b1. 構(gòu)建數(shù)據(jù)結(jié)構(gòu)instanceConfParam。
b2. 調(diào)用client.joinInstanceConf()接口創(chuàng)建并加入即時會議,b1中的instanceConfParam作為參數(shù)。
代碼示例:
function joinInstanceConf() { var confTypeObj = document.getElementById("instance_conf_type"); var confType = parseInt(confTypeObj.options[confTypeObj.selectedIndex].value); var attendeeInfo = document.getElementById("member_list").value; var isHdConfObj = document.getElementById("instance_is_HD_Conf"); var isHdConf = parseInt(isHdConfObj.options[isHdConfObj.selectedIndex].value); var array = attendeeInfo.split(","); var attendees = new Array(); for (var i = 0; i < array.length; i++) { attendees[i] = { number: array[i], name: "", smsPhone: "", email: "", autoInvite: 1, role: 0 }; } var instanceConfParam = { isVideo: confType, language: 1, attendees: attendees,isHdConf:isHdConf} client.joinInstanceConf(instanceConfParam, function callback(ret) {}); } |
參考文件:\usage\conference_usage.js。
c1. 構(gòu)建數(shù)據(jù)結(jié)構(gòu)anonymousConfParam和serverInfo。
c2. 調(diào)用client.joinAnonymousConf()接口匿名加入會議,c1中的anonymousConfParam和serverInfo作為參數(shù)。
代碼示例:
function joinAnonymousConf() { var conferenceId = document.getElementById("conferenceId").value; var accessNumber = document.getElementById("accessNumber").value; var confPasswd = document.getElementById("confPasswd").value; var serverAddress = document.getElementById("svr_addr").value; var serverPort = document.getElementById("svr_port").value; var anonymousConfParam = { confAccesscode: conferenceId + accessNumber, confPasswd: confPasswd, callType: 1 } var serverInfo = { serverAddress: serverAddress, serverPort: parseInt(serverPort) } client.joinAnonymousConf(anonymousConfParam, serverInfo, function callback(ret) { alert("joinAnonymousConf call back" + JSON.stringify(ret)) }); } |
d. 調(diào)用answerConference(false)接口拒絕會議邀請。
e. 調(diào)用answerConference(true)接口接受會議邀請。
代碼示例:
onConfIncoming: function (ret) { var con_ret = confirm("you have a incoming conference, accept?"); if (con_ret === true) { client.answerConference(true) } else { client.answerConference(false) } } |
參考文件:\usage\event_process.js。