帖子
帖子
用户
博客
课程
显示全部楼层
216
帖子
5
勋章
5893
Y币

nim模块测试demo

[复制链接]
发表于 2022-10-16 17:19:57
  1. <!DOCTYPE html>
  2. <html>

  3. <head>
  4.         <title>Module Develop</title>
  5.         <meta charset="utf-8">
  6.         <meta name="viewport"
  7.                 content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  8.         <style type="text/css">
  9.                 html,
  10.                 body {
  11.                         height: 100%
  12.                 }

  13.                 body {
  14.                         background-color: #fff;
  15.                         margin: 0;
  16.                 }

  17.                 #wrap {
  18.                         height: 100%;
  19.                         position: relative;
  20.                 }

  21.                 #header {
  22.                         padding-top: 20px;
  23.                         background-color: #5082c2;
  24.                         height: 44px;
  25.                         position: relative;
  26.                 }

  27.                 #header h1 {
  28.                         font-size: 20px;
  29.                         height: 44px;
  30.                         line-height: 44px;
  31.                         margin: 0em;
  32.                         color: #fff;
  33.                         margin-left: 100px;
  34.                         margin-right: 100px;
  35.                         text-align: center;
  36.                 }

  37.                 #main {
  38.                         display: -webkit-box;
  39.                         -webkit-box-orient: vertical;
  40.                         -webkit-box-pack: center;
  41.                 }

  42.                 a.button {
  43.                         display: -webkit-box;
  44.                         -webkit-box-orient: vertical;
  45.                         -webkit-box-pack: center;
  46.                         -webkit-box-align: center;
  47.                         height: 32px;
  48.                         margin: 8px;
  49.                         background-color: rgba(240, 240, 240, 1.0);
  50.                         border-color: rgba(220, 220, 220, 1.0);
  51.                         border-width: 2px;
  52.                         border-style: solid;
  53.                 }

  54.                 a.active {
  55.                         background-color: rgba(240, 240, 240, 0.7);
  56.                 }
  57.         </style>
  58. </head>

  59. <body>
  60.         <div id="wrap">
  61.                 <div id="main">
  62.                         <br />
  63.                         <br />
  64.                         <br />
  65.                         <br />
  66.                         <a class="button" tapmode="active" onclick="enablePushService()">enablePushService</a>


  67.                         <a class="button" tapmode="active" onclick="getLogPath()">getLogPath</a>
  68.                         <a class="button" tapmode="active" onclick="login()">登录</a>
  69.                         <a class="button" tapmode="active" onclick="logout()">退出</a>
  70.                         <a class="button" tapmode="active" onclick="onKick()">被踢的监听</a>
  71.                         <a class="button" tapmode="active" onclick="onMultiLoginClientsChanged()">多端登录监听</a>
  72.                         <a class="button" tapmode="active" onclick="willSendIMMessage()">即将发送消息监听</a>
  73.                         <!--update -->
  74.                         <a class="button" tapmode="active" onclick="onSendMessageWithProgress()">消息发送进度监听(文本消息会没有这个)</a>
  75.                         <a class="button" tapmode="active" onclick="onRecvIMMessages()">收到新消息监听</a>
  76.                         <!--update -->
  77.                         <a class="button" tapmode="active" onclick="allRecentSession()">获取最近会话</a>
  78.                         <a class="button" tapmode="active" onclick="fetchMessageHistory()">获取云端消息记录</a>
  79.                         <a class="button" tapmode="active" onclick="sendMessageReceipt()">发送已读回执</a>
  80.                         <a class="button" tapmode="active" onclick="onIMRecvMessageReceipt()">接受已读回执</a>
  81.                         <a class="button" tapmode="active" onclick="markAllMessagesReadInSession()">未读数清零</a>
  82.                         <br />
  83.                         <a class="button" tapmode="active" onclick="sendText()">发送文本消息及表情</a>
  84.                         <a class="button" tapmode="active" onclick="sendImage()">发送图片</a>
  85.                         <a class="button" tapmode="active" onclick="sendLocationMsg()">发送地理位置</a>
  86.                         <a class="button" tapmode="active" onclick="sendAudio()">发送音频</a>
  87.                         <a class="button" tapmode="active" onclick="sendVideo()">发送视频</a>
  88.                         <a class="button" tapmode="active" onclick="sendFile()">发送文件</a>
  89.                         <br />
  90.                         <a class="button" tapmode="active" onclick="switchAudioOutputDevice()">切换音频的输出设备</a>
  91.                         <a class="button" tapmode="active" onclick="isPlaying()">判断是否正在播放音频</a>
  92.                         <a class="button" tapmode="active" onclick="playAudio()">播放音频</a>
  93.                         <a class="button" tapmode="active" onclick="stopPlay()">停止播放音频</a>
  94.                         <br />
  95.                         <a class="button" tapmode="active" onclick="isRecording()">判断是否正在录制音频</a>
  96.                         <a class="button" tapmode="active" onclick="recordAudioForDuration()">录音</a>
  97.                         <a class="button" tapmode="active" onclick="cancelRecord()">取消录音</a>
  98.                         <a class="button" tapmode="active" onclick="stopRecord()">停止录制音频</a>
  99.                         <br />
  100.                         <a class="button" tapmode="active" onclick="onIMTeamRemoved()">群组移除监听</a>
  101.                         <!--update -->
  102.                         <a class="button" tapmode="active" onclick="onIMTeamUpdated()">群组更新监听</a>
  103.                         <!--update -->
  104.                         <a class="button" tapmode="active" onclick="onIMTeamMemberChanged()">群成员改变监听</a>
  105.                         <!--update -->
  106.                         <a class="button" tapmode="active" onclick="allMyTeams()">获取我的所有群组</a>
  107.                         <a class="button" tapmode="active" onclick="teamById()">本地获取群组信息</a>
  108.                         <a class="button" tapmode="active" onclick="fetchTeamInfo()">远程获取群组信息</a>
  109.                         <!--update -->
  110.                         <a class="button" tapmode="active" onclick="createTeam()">创建群组</a>
  111.                         <a class="button" tapmode="active" onclick="addUsers()">邀请用户入群</a>
  112.                         <a class="button" tapmode="active" onclick="acceptInviteWithTeam()">同意群邀请(仅限高级群)</a>
  113.                         <a class="button" tapmode="active" onclick="rejectInviteWithTeam()">拒绝群邀请(仅限高级群)</a>
  114.                         <a class="button" tapmode="active" onclick="applyToTeam()">用户主动申请加群</a>
  115.                         <a class="button" tapmode="active" onclick="passApplyToTeam()">通过申请(仅限高级群)</a>
  116.                         <a class="button" tapmode="active" onclick="rejectApplyToTeam()">拒绝申请(仅限高级群)</a>
  117.                         <a class="button" tapmode="active" onclick="updateTeamName()">修改群名称</a>
  118.                         <a class="button" tapmode="active" onclick="updateTeamIntro()">修改群介绍</a>
  119.                         <a class="button" tapmode="active" onclick="updateTeamAnnouncement()">修改群公告</a>
  120.                         <a class="button" tapmode="active" onclick="updateTeamJoinMode()">修改群验证方式</a>
  121.                         <a class="button" tapmode="active" onclick="addManagersToTeam()">提升管理员(仅限高级群)</a>
  122.                         <a class="button" tapmode="active" onclick="removeManagersFromTeam()">移除管理员(仅限高级群)</a>
  123.                         <a class="button" tapmode="active" onclick="transferManagerWithTeam()">转让群(仅限高级群)</a>
  124.                         <a class="button" tapmode="active" onclick="fetchTeamMembers()">获取群成员</a>
  125.                         <a class="button" tapmode="active" onclick="quitTeam()">用户退群</a>
  126.                         <a class="button" tapmode="active" onclick="kickUsers()">踢出用户</a>
  127.                         <a class="button" tapmode="active" onclick="dismissTeam()">解散群</a>
  128.                         <a class="button" tapmode="active" onclick="updateNotifyStateForTeam()">修改群消息通知状态 (关闭群消息提醒)</a>
  129.                         <br />
  130.                         <a class="button" tapmode="active" onclick="onIMSystemMessageRecieved()">内置系统通知监听</a>
  131.                         <!--update -->
  132.                         <a class="button" tapmode="active" onclick="fetchSystemNotifications()">获取本地存储的内置系统通知</a>
  133.                         <a class="button" tapmode="active" onclick="allNotificationsUnreadCount()">获取本地存储的内置系统未读数</a>
  134.                         <a class="button" tapmode="active" onclick="deleteAllNotifications()">删除本地存储的全部内置系统通知</a>
  135.                         <a class="button" tapmode="active" onclick="markAllNotificationsAsRead()">标记本地存储的全部内置系统通知为已读</a>
  136.                         <br />
  137.                         <a class="button" tapmode="active" onclick="onUserInfoUpdate()">用户个人信息发生变化监听</a>
  138.                         <a class="button" tapmode="active" onclick="onBlackListChanged()">黑名单列表发生变化监听</a>
  139.                         <!--add -->
  140.                         <a class="button" tapmode="active" onclick="userInfo()">获取用户资料</a>
  141.                         <a class="button" tapmode="active" onclick="fetchUserInfos()">获取服务器用户资料</a>
  142.                         <a class="button" tapmode="active" onclick="updateMyUserInfo()">更新当前用户信息</a>
  143.                         <br />
  144.                         <a class="button" tapmode="active" onclick="myFriends()">获取好友列表</a>
  145.                         <a class="button" tapmode="active" onclick="requestFriend()">好友请求</a>
  146.                         <a class="button" tapmode="active" onclick="deleteFriend()">删除好友</a>
  147.                         <a class="button" tapmode="active" onclick="myBlackList()">获取黑名单成员列表</a>
  148.                         <a class="button" tapmode="active" onclick="addToBlackList()">添加用户到黑名单</a>
  149.                         <a class="button" tapmode="active" onclick="removeFromBlackBlackList()">将用户移除黑名单</a>
  150.                         <a class="button" tapmode="active" onclick="isUserInBlackList()">判断某用户是否在自己的黑名单中</a>
  151.                         <a class="button" tapmode="active" onclick="myMuteUserList()">获取静音成员列表</a>
  152.                         <a class="button" tapmode="active" onclick="updateNotifyStateForUser()">设置消息提醒</a>
  153.                         <a class="button" tapmode="active" onclick="notifyForNewMsgForUser()">判断是否需要消息通知</a>
  154.                         <br />
  155.                         <a class="button" tapmode="active" onclick="onChatRoomStatusChanged()">聊天室在线状态变化的监听</a>
  156.                         <a class="button" tapmode="active" onclick="onChatRoomKickOutEvent()">被踢出聊天室的监听</a>
  157.                         <a class="button" tapmode="active" onclick="enterChatRoom()">用户加入聊天室</a>
  158.                         <a class="button" tapmode="active" onclick="exitChatRoom()">用户退出聊天室</a>
  159.                         <a class="button" tapmode="active" onclick="getChatRoomHistoryMsg()">获取聊天室历史消息</a>
  160.                         <a class="button" tapmode="active" onclick="getChatRoomInfo()">获取聊天室基本信息</a>
  161.                         <a class="button" tapmode="active" onclick="getChatRoomMembers()">获取聊天室成员</a>
  162.                         <a class="button" tapmode="active" onclick="getChatRoomMembersByIds()">批量获取指定成员在聊天室中的信息</a>
  163.                         <a class="button" tapmode="active" onclick="addUserToBlackList()">加入/移出黑名单</a>
  164.                         <a class="button" tapmode="active" onclick="muteUser()">加入用户到禁言名单/取消某用户的禁言</a>
  165.                         <a class="button" tapmode="active" onclick="setAdmin()">设置/取消管理员</a>
  166.                         <a class="button" tapmode="active" onclick="setNormal()">设置/移除普通成员</a>
  167.                         <a class="button" tapmode="active" onclick="kickMemberFromChatRoom()">从聊天室中移除某个用户</a>
  168.                         <br />
  169.                         <a class="button" tapmode="active" onclick="addLocalVideo()">addLocalVideo</a>
  170.                         <!--                <a class="button" tapmode="active" onclick="startCall()" >发起通话(主叫方)</a>-->
  171.                         <!--                <a class="button" tapmode="active" onclick="onCallReceive()" >被叫收到呼叫监听(被叫方)</a>-->
  172.                         <!--                <a class="button" tapmode="active" onclick="responseCall()" >被叫响应呼叫(被叫方)</a>-->
  173.                         <!--                <a class="button" tapmode="active" onclick="onCallResponse()" >主叫收到被叫响应监听(主叫方)</a>-->
  174.                         <!--                <a class="button" tapmode="active" onclick="onCallCallEstablished()" >点对点通话建立成功监听</a>-->
  175.                         <!--                <a class="button" tapmode="active" onclick="onCallCallDisconnected()" >通话异常断开监听</a>-->
  176.                         <!--                <a class="button" tapmode="active" onclick="callControl()" >发送网络通话的控制信息(发起方)</a>-->
  177.                         <!--                <a class="button" tapmode="active" onclick="onCallControl()" >收到对方网络通话控制信息监听(接收方)</a>-->
  178.                         <!--                <a class="button" tapmode="active" onclick="callHangup()" >挂断通话</a>-->
  179.                         <!--                <a class="button" tapmode="active" onclick="onCallHangup()" >对方挂断电话监听</a>-->
  180.                         <!--                -->
  181.                         <!--                <a class="button" tapmode="active" onclick="currentCallID()" >获取正在进行中的网络通话call id</a>-->
  182.                         <!--                <a class="button" tapmode="active" onclick="onCallNetStatus()" >当前通话网络状态监听</a>-->
  183.                         <!--                -->
  184.                         <!--                <a class="button" tapmode="active" onclick="initCallRemoteView()" >初始化视频通话界面</a>-->
  185.                         <!--                <a class="button" tapmode="active" onclick="removeCallRemoteView()" >移除视频通话界面</a>-->
  186.                         <!--                <a class="button" tapmode="active" onclick="setCallMute()" >设置网络通话静音模式</a>-->
  187.                         <!--                <a class="button" tapmode="active" onclick="setCallSpeaker()" >设置网络通话扬声器模式</a>-->
  188.                         <!--                <a class="button" tapmode="active" onclick="switchCallCamera()" >切换网络通话摄像头</a>-->
  189.                         <!--                <a class="button" tapmode="active" onclick="switchCallCameraFlash()" >切换闪光灯开关</a>-->
  190.                         <!--                -->
  191.                         <!--                <a class="button" tapmode="active" onclick="startNetDetect()" >开始网络探测任务</a>-->
  192.                         <!--                <a class="button" tapmode="active" onclick="stopNetDetect()" >停止网络探测任务</a>-->

  193.                         <a class="button" tapmode="active" onclick="noticeClicked()">noticeClicked</a>
  194.                 </div>
  195.         </div>
  196. </body>
  197. <script>
  198.         var mFilePath = 'widget://res/bandari.mp3';
  199.         var demo = null;
  200.         var _taskId;
  201.         var _callID;
  202.         apiready = function () {
  203.                 demo = api.require('nim');
  204.                 if (!demo) {
  205.                         alert("请添加模块后编译");
  206.                         return;
  207.                 }

  208.         }

  209.         function noticeClicked() {
  210.                 demo.noticeClicked(function (ret, err) {
  211.                         alert("noticeclicked>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  212.                 });
  213.         }

  214.         function enablePushService() {
  215.                 demo.enablePushService({
  216.                         enable: true
  217.                 }, function (ret, err) {
  218.                         alert("enablePushService>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  219.                 });
  220.         }

  221.         function markAllMessagesReadInSession() {
  222.                 demo.markAllMessagesReadInSession({
  223.                         sessionId: '1004',
  224.                         sessionType: 0,
  225.                 }, function (ret, err) {
  226.                         alert("sendText>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  227.                 });
  228.         }

  229.         function sendMessageReceipt() {
  230.                 demo.sendMessageReceipt({
  231.                         sessionId: '1004',
  232.                         sessionType: 1,
  233.                 }, function (ret, err) {
  234.                         alert("sendMessageReceipt>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  235.                 });
  236.         }

  237.         function onIMRecvMessageReceipt() {
  238.                 demo.onIMRecvMessageReceipt(function (ret, err) {
  239.                         alert("onIMRecvMessageReceipt>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  240.                 });
  241.         }

  242.         function getLogPath() {
  243.                 demo.getLogPath(function (ret, err) {
  244.                         alert("getLogPath>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  245.                 });
  246.         }

  247.         function switchCallCamera() {
  248.                 demo.switchCallCamera(function (ret, err) {
  249.                         alert("switchCallCamera>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  250.                 });
  251.         }

  252.         function switchCallCameraFlash() {
  253.                 demo.switchCallCameraFlash(function (ret, err) {
  254.                         alert("switchCallCameraFlash>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  255.                 });
  256.         }

  257.         function stopNetDetect() {
  258.                 demo.stopNetDetect({
  259.                         taskId: _taskId //需要停止的任务的 id
  260.                 }, function (ret, err) {
  261.                         alert("stopNetDetect>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  262.                 });
  263.         }

  264.         function startNetDetect() {
  265.                 demo.startNetDetect(function (ret, err) {//return taskId
  266.                         alert("startNetDetect>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  267.                         _taskId = ret.taskId;
  268.                 });
  269.         }

  270.         function setCallSpeaker() {
  271.                 demo.setCallSpeaker({
  272.                         useSpeaker: true //是否开启扬声器
  273.                 }, function (ret, err) {
  274.                         alert("setCallSpeaker>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  275.                 });
  276.         }

  277.         function setCallMute() {
  278.                 demo.setCallMute({
  279.                         mute: true //是否开启静音
  280.                 }, function (ret, err) {
  281.                         alert("setCallMute>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  282.                 });
  283.         }

  284.         function removeCallRemoteView() {
  285.                 demo.removeCallRemoteView(function (ret, err) {
  286.                         alert("removeCallRemoteView>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  287.                 });
  288.         }

  289.         function initCallRemoteView() {
  290.                 demo.initCallRemoteView({
  291.                         remoteRect: {
  292.                                 x: 0,
  293.                                 y: 0,
  294.                                 w: api.frameWidth,
  295.                                 h: api.frameHeight / 2
  296.                         },
  297.                         localRect: {
  298.                                 x: 5,
  299.                                 y: api.frameHeight - api.frameHeight / 3 - 5,
  300.                                 w: api.frameWidth / 3,
  301.                                 h: api.frameHeight / 3
  302.                         },
  303.                         fixedOn: api.frameName,
  304.                         fixed: true
  305.                 }, function (ret, err) {
  306.                         alert("initCallRemoteView>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));

  307.                 });
  308.         }

  309.         function onCallNetStatus() {
  310.                 demo.onCallNetStatus(function (ret, err) {
  311.                         alert("onCallNetStatus>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  312.                 });
  313.         }

  314.         function currentCallID() {
  315.                 demo.currentCallID(function (ret, err) {
  316.                         alert("currentCallID>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  317.                 });
  318.         }

  319.         function onCallHangup() {
  320.                 demo.onCallHangup(function (ret, err) {
  321.                         alert("onCallHangup>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  322.                 });
  323.         }

  324.         function callHangup() {
  325.                 demo.callHangup({
  326.                         callID: _callID,    //call id
  327.                 }, function (ret, err) {
  328.                         alert("callHangup>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  329.                 });
  330.         }

  331.         function onCallControl() {
  332.                 demo.onCallControl(function (ret, err) {
  333.                         alert("onCallControl>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  334.                 });
  335.         }

  336.         function callControl() {
  337.                 demo.callControl({
  338.                         callID: _callID,    //call id
  339.                         type: 1       //1:开启了音频 2:关闭了音频 3:开启了视频 4:关闭了视频 5:切换到视频模式 6:同意切换到视频模式 7:拒绝切换到视频模式
  340.                         //8:切换到音频模式 9:占线 10:没有可用摄像头(仅ios) 11:应用切换到了后台(仅ios) 12:收到呼叫请求的反馈,通常用于被叫告诉主叫可以播放回铃音了
  341.                         //13:开始录制 14:结束录制
  342.                 }, function (ret, err) {
  343.                         alert("callControl>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  344.                 });
  345.         }

  346.         function onCallCallDisconnected() {
  347.                 demo.onCallCallDisconnected(function (ret, err) {
  348.                         alert("onCallCallDisconnected>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  349.                 });
  350.         }

  351.         function onCallCallEstablished() {
  352.                 demo.onCallCallEstablished(function (ret, err) {
  353.                         alert("onCallCallEstablished>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  354.                 });
  355.         }

  356.         function onCallResponse() {
  357.                 demo.onCallResponse(function (ret, err) {
  358.                         alert("onCallResponse>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  359.                 });
  360.         }

  361.         function responseCall() {
  362.                 demo.responseCall({
  363.                         callID: _callID,    //call id
  364.                         accept: true  //是否接听
  365.                 }, function (ret, err) {
  366.                         alert("responseCall>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  367.                 });
  368.         }

  369.         function onCallReceive() {
  370.                 demo.onCallReceive(function (ret, err) {//return callID
  371.                         alert("onCallReceive>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  372.                         _callID = ret.callID;
  373.                         initCallRemoteView();
  374.                 });
  375.         }

  376.         function startCall() {
  377.                 demo.startCall({
  378.                         type: 2,    // 呼叫类型 1:音频 2:视频
  379.                         callees: ['zf1002'],  //被叫帐号列表, 现在只支持传入一个被叫
  380.                         serverRecord: true  //是否开启服务端录制
  381.                 }, function (ret, err) {//return callID
  382.                         alert("startCall>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  383.                         _callID = ret.callID;
  384.                         initCallRemoteView();
  385.                 });
  386.         }


  387.         function login() {
  388.                 demo.login({
  389.                         userId: 'fa04047d6a2523fd0729081651391db2',
  390.                         password: '1a512235723c3131eeba8493144faa10',
  391.                 }, function (ret, err) {
  392.                         alert("login>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  393.                 });
  394.         }

  395.         function onKick() {
  396.                 demo.onKick(function (ret, err) {
  397.                         alert("onKick>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  398.                 });
  399.         }

  400.         function onMultiLoginClientsChanged() {
  401.                 demo.onMultiLoginClientsChanged(function (ret, err) {
  402.                         alert("onMultiLoginClientsChanged>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  403.                 });
  404.         }

  405.         function logout() {
  406.                 demo.logout(function (ret, err) {
  407.                         alert("logout>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  408.                 });
  409.         }

  410.         function willSendIMMessage() {
  411.                 demo.willSendIMMessage(function (ret, err) {
  412.                         alert("willSendIMMessage>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  413.                 });
  414.         }

  415.         function onSendMessageWithProgress() {
  416.                 demo.onSendMessageWithProgress(function (ret, err) {
  417.                         alert("onSendMessageWithProgress>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  418.                 });
  419.         }

  420.         function sendText() {
  421.                 demo.sendText({
  422.                         sessionId: '1004',
  423.                         sessionType: 1,
  424.                         content: '我是10001文本测试群聊测试',
  425.                         ext: {
  426.                                 key: 'key1'
  427.                         }
  428.                 }, function (ret, err) {
  429.                         alert("sendText>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  430.                 });
  431.         }

  432.         function sendImage() {
  433.                 demo.sendImage({
  434.                         sessionId: '1004',
  435.                         sessionType: 0,
  436.                         filePath: 'widget://image/bottombtn0101.png',
  437.                         displayName: '我是10001图片',
  438.                         ext: {
  439.                                 key: 'key1'
  440.                         }
  441.                 }, function (ret, err) {
  442.                         alert("sendImage>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  443.                 });
  444.         }

  445.         function sendLocationMsg() {
  446.                 demo.sendLocationMsg({
  447.                         sessionId: '1004',
  448.                         sessionType: 0,
  449.                         title: '我是10001地理位置',
  450.                         latitude: 102,
  451.                         longitude: 39,
  452.                         ext: {
  453.                                 key: 'key1'
  454.                         }
  455.                 }, function (ret, err) {
  456.                         alert("sendLocationMsg>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  457.                 });
  458.         }

  459.         function sendAudio() {
  460.                 demo.sendAudio({
  461.                         sessionId: '10002',
  462.                         sessionType: 0,
  463.                         filePath: mFilePath,
  464.                         ext: {
  465.                                 key: 'key1'
  466.                         }
  467.                 }, function (ret, err) {
  468.                         alert("sendAudio>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  469.                 });
  470.         }

  471.         function sendVideo() {
  472.                 demo.sendVideo({
  473.                         sessionId: '10002',
  474.                         sessionType: 0,
  475.                         filePath: 'widget://res/test1.mp4',
  476.                         displayName: '我是10001视频',
  477.                         ext: {
  478.                                 key: 'key1'
  479.                         }
  480.                 }, function (ret, err) {
  481.                         alert("sendVideo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  482.                 });
  483.         }

  484.         function sendFile() {
  485.                 demo.sendFile({
  486.                         sessionId: '10002',
  487.                         sessionType: 0,
  488.                         filePath: 'widget://res/sendFile.txt',
  489.                         displayName: '我是10001文件',
  490.                         ext: {
  491.                                 key: 'key1'
  492.                         }
  493.                 }, function (ret, err) {
  494.                         alert("sendVideo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  495.                 });
  496.         }

  497.         function onRecvIMMessages() {
  498.                 demo.onRecvIMMessages(function (ret, err) {
  499.                         alert("onRecvIMMessages>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  500.                 });
  501.         }

  502.         function allRecentSession() {
  503.                 demo.allRecentSession(function (ret, err) {
  504.                         alert("allRecentSession>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  505.                 });
  506.         }

  507.         function fetchMessageHistory() {
  508.                 demo.fetchMessageHistory({
  509.                         sessionId: '10002',
  510.                         sessionType: 0,
  511.                         limit: 100,
  512.                         sync: false,
  513.                         startTime: 0
  514.                 }, function (ret, err) {
  515.                         alert("fetchMessageHistory>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  516.                 });
  517.         }

  518.         function switchAudioOutputDevice() {
  519.                 demo.switchAudioOutputDevice({
  520.                         outputDevice: 1
  521.                 }, function (ret, err) {
  522.                         alert("switchAudioOutputDevice>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  523.                 });
  524.         }

  525.         function isPlaying() {
  526.                 demo.isPlaying(function (ret, err) {
  527.                         alert("isPlaying>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  528.                 });
  529.         }

  530.         function playAudio() {
  531.                 alert(mFilePath);
  532.                 if (mFilePath) {
  533.                         demo.playAudio({
  534.                                 filePath: mFilePath
  535.                         }, function (ret, err) {
  536.                                 alert("playAudio>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  537.                         });
  538.                 }
  539.         }

  540.         function stopPlay() {
  541.                 demo.stopPlay(function (ret, err) {
  542.                         alert("stopPlay>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  543.                 });
  544.         }

  545.         function isRecording() {
  546.                 demo.isRecording(function (ret, err) {
  547.                         alert("isRecording>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  548.                 });
  549.         }

  550.         function recordAudioForDuration() {
  551.                 demo.recordAudioForDuration({
  552.                         duration: 60
  553.                 }, function (ret, err) {
  554.                         alert("recordAudioForDuration>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  555.                         if (ret.status) {
  556.                                 if (ret.evenType == 'success') {
  557.                                         mFilePath = ret.filePath;
  558.                                 }
  559.                         }
  560.                 });
  561.         }

  562.         function cancelRecord() {
  563.                 demo.cancelRecord(function (ret, err) {
  564.                         alert("cancelRecord>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  565.                 });
  566.         }

  567.         function stopRecord() {
  568.                 demo.stopRecord(function (ret, err) {
  569.                         alert("stopRecord>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  570.                 });
  571.         }

  572.         function onIMTeamRemoved() {
  573.                 demo.onIMTeamRemoved(function (ret, err) {
  574.                         alert("onIMTeamRemoved>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  575.                 });
  576.         }

  577.         function onIMTeamUpdated() {
  578.                 demo.onIMTeamUpdated(function (ret, err) {
  579.                         alert("onIMTeamUpdated>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  580.                 });
  581.         }

  582.         function onIMTeamMemberChanged() {
  583.                 demo.onIMTeamMemberChanged(function (ret, err) {
  584.                         alert("onIMTeamUpdated>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  585.                 });
  586.         }

  587.         function allMyTeams() {
  588.                 demo.allMyTeams(function (ret, err) {
  589.                         alert("allMyTeams>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  590.                 });
  591.         }

  592.         function teamById() {
  593.                 demo.teamById({
  594.                         teamId: '123458848'
  595.                 }, function (ret, err) {
  596.                         alert("teamById>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  597.                 });
  598.         }

  599.         function fetchTeamInfo() {
  600.                 demo.fetchTeamInfo({
  601.                         teamId: '123458848'
  602.                 }, function (ret, err) {
  603.                         alert("fetchTeamInfo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  604.                 });
  605.         }

  606.         function createTeam() {
  607.                 demo.createTeam({
  608.                         name: '消费10001测试',
  609.                         type: 0,
  610.                         joinMode: 0,
  611.                         postscript: '',
  612.                         intro: '',
  613.                         announcement: '',
  614.                         users: ['10002']
  615.                 }, function (ret, err) {
  616.                         alert("createTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  617.                 });
  618.         }

  619.         function addUsers() {
  620.                 demo.addUsers({
  621.                         teamId: '123458848',
  622.                         users: ['1003']
  623.                 }, function (ret, err) {
  624.                         alert("addUsers>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  625.                 });
  626.         }

  627.         function acceptInviteWithTeam() {
  628.                 demo.acceptInviteWithTeam({
  629.                         teamId: '123458848', //群Id
  630.                         invitorId: '10002'//邀请者Id(不是被邀请者)
  631.                 }, function (ret, err) {
  632.                         alert("acceptInviteWithTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  633.                 });
  634.         }

  635.         function rejectInviteWithTeam() {
  636.                 demo.rejectInviteWithTeam({
  637.                         teamId: '123458848', //群Id
  638.                         invitorId: '10002', //邀请者Id(不是被邀请者)
  639.                         rejectReason: ''
  640.                 }, function (ret, err) {
  641.                         alert("rejectInviteWithTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  642.                 });
  643.         }

  644.         function applyToTeam() {
  645.                 demo.applyToTeam({
  646.                         teamId: '123458848', //群Id
  647.                         message: '我要加群!'//加群信息
  648.                 }, function (ret, err) {
  649.                         alert("applyToTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  650.                 });
  651.         }

  652.         function passApplyToTeam() {
  653.                 demo.passApplyToTeam({
  654.                         teamId: '123458848', //群Id
  655.                         userId: '10001'//用户Id
  656.                 }, function (ret, err) {
  657.                         alert("passApplyToTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  658.                 });
  659.         }

  660.         function rejectApplyToTeam() {
  661.                 demo.rejectApplyToTeam({
  662.                         teamId: '123458848', //群Id
  663.                         userId: '10001', //用户Id
  664.                         rejectReason: ''
  665.                 }, function (ret, err) {
  666.                         alert("rejectApplyToTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  667.                 });
  668.         }

  669.         function updateTeamName() {
  670.                 demo.updateTeamName({
  671.                         teamId: '123458848', //群Id
  672.                         teamName: '修改群名称'
  673.                 }, function (ret, err) {
  674.                         alert("updateTeamName>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  675.                 });
  676.         }

  677.         function updateTeamIntro() {
  678.                 demo.updateTeamIntro({
  679.                         teamId: '123458848', //群Id
  680.                         intro: '修改群介绍'
  681.                 }, function (ret, err) {
  682.                         alert("updateTeamIntro>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  683.                 });
  684.         }

  685.         function updateTeamAnnouncement() {
  686.                 demo.updateTeamAnnouncement({
  687.                         teamId: '123458848', //群Id
  688.                         announcement: '修改群公告'
  689.                 }, function (ret, err) {
  690.                         alert("updateTeamAnnouncement>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  691.                 });
  692.         }

  693.         function updateTeamJoinMode() {
  694.                 demo.updateTeamJoinMode({
  695.                         teamId: '123458848', //群Id
  696.                         joinMode: 1 //群验证方式,允许所有人加入:0,需要验证:1,不允许任何人加入:2
  697.                 }, function (ret, err) {
  698.                         alert("updateTeamJoinMode>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  699.                 });
  700.         }

  701.         function addManagersToTeam() {
  702.                 demo.addManagersToTeam({
  703.                         teamId: '123458848', //群Id
  704.                         users: ['10002', '10001']
  705.                 }, function (ret, err) {
  706.                         alert("addManagersToTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  707.                 });
  708.         }

  709.         function removeManagersFromTeam() {
  710.                 demo.removeManagersFromTeam({
  711.                         teamId: '123458848', //群Id
  712.                         users: ['10002', '10001']
  713.                 }, function (ret, err) {
  714.                         alert("removeManagersFromTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  715.                 });
  716.         }

  717.         function transferManagerWithTeam() {
  718.                 demo.transferManagerWithTeam({
  719.                         teamId: '123458848', //群Id
  720.                         newOwnerId: '10001',
  721.                         isLeave: false
  722.                 }, function (ret, err) {
  723.                         alert("transferManagerWithTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  724.                 });
  725.         }

  726.         function fetchTeamMembers() {
  727.                 demo.fetchTeamMembers({
  728.                         teamId: '123458848'
  729.                 }, function (ret, err) {
  730.                         alert("fetchTeamMembers>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  731.                 });
  732.         }

  733.         function quitTeam() {
  734.                 demo.quitTeam({
  735.                         teamId: '123458848'
  736.                 }, function (ret, err) {
  737.                         alert("quitTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  738.                 });
  739.         }

  740.         function kickUsers() {
  741.                 demo.kickUsers({
  742.                         teamId: '123458848',
  743.                         users: ['10002']
  744.                 }, function (ret, err) {
  745.                         alert("kickUsers>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  746.                 });
  747.         }

  748.         function dismissTeam() {
  749.                 demo.dismissTeam({
  750.                         teamId: '123458848'
  751.                 }, function (ret, err) {
  752.                         alert("dismissTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  753.                 });
  754.         }

  755.         function updateNotifyStateForTeam() {
  756.                 demo.updateNotifyStateForTeam({
  757.                         teamId: '123458848',
  758.                         notify: false
  759.                 }, function (ret, err) {
  760.                         alert("updateNotifyStateForTeam>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  761.                 });
  762.         }

  763.         function onIMSystemMessageRecieved() {
  764.                 demo.onIMSystemMessageRecieved(function (ret, err) {
  765.                         alert("onIMSystemMessageRecieved>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  766.                 });
  767.         }

  768.         function fetchSystemNotifications() {
  769.                 demo.fetchSystemNotifications({
  770.                         limit: 10
  771.                 }, function (ret, err) {
  772.                         alert("fetchSystemNotifications>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  773.                 });
  774.         }

  775.         function allNotificationsUnreadCount() {
  776.                 demo.allNotificationsUnreadCount(function (ret, err) {
  777.                         alert("allNotificationsUnreadCount>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  778.                 });
  779.         }

  780.         function deleteAllNotifications() {
  781.                 demo.deleteAllNotifications(function (ret, err) {
  782.                         alert("deleteAllNotifications>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  783.                 });
  784.         }

  785.         function markAllNotificationsAsRead() {
  786.                 demo.markAllNotificationsAsRead(function (ret, err) {
  787.                         alert("markAllNotificationsAsRead>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  788.                 });
  789.         }

  790.         function onUserInfoUpdate() {
  791.                 demo.onUserInfoUpdate(function (ret, err) {
  792.                         alert("onUserInfoUpdate>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  793.                 });
  794.         }

  795.         function onBlackListChanged() {
  796.                 demo.onBlackListChanged(function (ret, err) {
  797.                         alert("onBlackListChanged>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  798.                 });
  799.         }

  800.         function userInfo() {
  801.                 demo.userInfo({
  802.                         userId: '10002'
  803.                 }, function (ret, err) {
  804.                         alert("userInfo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  805.                 });
  806.         }

  807.         function fetchUserInfos() {
  808.                 demo.fetchUserInfos({
  809.                         userIds: ['49fefa64102589adcd13293973eca59b', '3234cfed1ad8e4a85f0721a4f3a4eb0c']
  810.                 }, function (ret, err) {
  811.                         alert("fetchUserInfos>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  812.                 });
  813.         }

  814.         function updateMyUserInfo() {
  815.                 demo.updateMyUserInfo({
  816.                         nickname: '昵称',
  817.                         avatar: '',
  818.                         sign: '',
  819.                         gender: 1,
  820.                         email: '176142998**.**',
  821.                         birth: '2010-10-08',
  822.                         mobile: '13000000000',
  823.                         ext: {
  824.                                 key: 'key2'
  825.                         }
  826.                 }, function (ret, err) {
  827.                         alert("updateMyUserInfo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  828.                 });
  829.         }

  830.         function myFriends() {
  831.                 demo.myFriends(function (ret, err) {
  832.                         alert("myFriends>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  833.                 });
  834.         }

  835.         function requestFriend() {
  836.                 demo.requestFriend({
  837.                         userId: '10001',
  838.                         operation: 1,
  839.                         message: ''
  840.                 }, function (ret, err) {
  841.                         alert("requestFriend>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  842.                 });
  843.         }

  844.         function deleteFriend() {
  845.                 demo.deleteFriend({
  846.                         userId: '10001'
  847.                 }, function (ret, err) {
  848.                         alert("deleteFriend>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  849.                 });
  850.         }

  851.         function myBlackList() {
  852.                 demo.myBlackList(function (ret, err) {
  853.                         alert("myBlackList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  854.                 });
  855.         }

  856.         function addToBlackList() {
  857.                 demo.addToBlackList({
  858.                         userId: '10001'
  859.                 }, function (ret, err) {
  860.                         alert("myBlackList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  861.                 });
  862.         }

  863.         function removeFromBlackBlackList() {
  864.                 demo.removeFromBlackBlackList({
  865.                         userId: '10001'
  866.                 }, function (ret, err) {
  867.                         alert("removeFromBlackBlackList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  868.                 });
  869.         }

  870.         function isUserInBlackList() {
  871.                 demo.isUserInBlackList({
  872.                         userId: '10001'
  873.                 }, function (ret, err) {
  874.                         alert("isUserInBlackList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  875.                 });
  876.         }

  877.         function myMuteUserList() {
  878.                 demo.myMuteUserList(function (ret, err) {
  879.                         alert("myMuteUserList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  880.                 });
  881.         }

  882.         function updateNotifyStateForUser() {
  883.                 demo.updateNotifyStateForUser({
  884.                         userId: '10001',
  885.                         notify: false
  886.                 }, function (ret, err) {
  887.                         alert("updateNotifyStateForUser>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  888.                 });
  889.         }

  890.         function notifyForNewMsgForUser() {
  891.                 demo.notifyForNewMsgForUser({
  892.                         userId: '10001'
  893.                 }, function (ret, err) {
  894.                         alert("notifyForNewMsgForUser>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  895.                 });
  896.         }

  897.         function onChatRoomStatusChanged() {
  898.                 demo.onChatRoomStatusChanged(function (ret, err) {
  899.                         alert("onChatRoomStatusChanged>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  900.                 });
  901.         }

  902.         function onChatRoomKickOutEvent() {
  903.                 demo.onChatRoomKickOutEvent(function (ret, err) {
  904.                         alert("onChatRoomKickOutEvent>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  905.                 });
  906.         }

  907.         function enterChatRoom() {
  908.                 demo.enterChatRoom({
  909.                         roomId: '26216092',
  910.                         nickName: '小飞',
  911.                         avatar: '',
  912.                         extension: {
  913.                                 key: 'key1'
  914.                         },
  915.                         notifyExtension: {
  916.                                 key: 'key2'
  917.                         },
  918.                 }, function (ret, err) {
  919.                         alert("enterChatRoom>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  920.                 });
  921.         }

  922.         function exitChatRoom() {
  923.                 demo.exitChatRoom({
  924.                         roomId: '9769955'
  925.                 }, function (ret, err) {
  926.                         alert("exitChatRoom>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  927.                 });
  928.         }

  929.         function getChatRoomHistoryMsg() {
  930.                 demo.getChatRoomHistoryMsg({
  931.                         roomId: '9769955'
  932.                 }, function (ret, err) {
  933.                         alert("getChatRoomHistoryMsg>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  934.                 });
  935.         }

  936.         function getChatRoomInfo() {
  937.                 demo.getChatRoomInfo({
  938.                         roomId: '9769955'
  939.                 }, function (ret, err) {
  940.                         alert("getChatRoomInfo>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  941.                 });
  942.         }

  943.         function getChatRoomMembers() {
  944.                 demo.getChatRoomMembers({
  945.                         roomId: '9769955',
  946.                         type: 0,
  947.                         time: 0,
  948.                         limit: 10
  949.                 }, function (ret, err) {
  950.                         alert("getChatRoomMembers>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  951.                 });
  952.         }

  953.         function getChatRoomMembersByIds() {
  954.                 demo.getChatRoomMembersByIds({
  955.                         roomId: '9769955',
  956.                         userIds: ['10002', '10001']
  957.                 }, function (ret, err) {
  958.                         alert("getChatRoomMembersByIds>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  959.                 });
  960.         }

  961.         function addUserToBlackList() {
  962.                 demo.addUserToBlackList({
  963.                         roomId: '9769955',
  964.                         userId: '10001',
  965.                         isAdd: true
  966.                 }, function (ret, err) {
  967.                         alert("addUserToBlackList>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  968.                 });
  969.         }

  970.         function muteUser() {
  971.                 demo.muteUser({
  972.                         roomId: '9769955',
  973.                         userId: '10001',
  974.                         isMute: true
  975.                 }, function (ret, err) {
  976.                         alert("muteUser>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  977.                 });
  978.         }

  979.         function setAdmin() {
  980.                 demo.setAdmin({
  981.                         roomId: '9769955',
  982.                         userId: '10001',
  983.                         isAdmin: true
  984.                 }, function (ret, err) {
  985.                         alert("setAdmin>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  986.                 });
  987.         }

  988.         function setNormal() {
  989.                 demo.setNormal({
  990.                         roomId: '9769955',
  991.                         userId: '10001',
  992.                         isNormal: true
  993.                 }, function (ret, err) {
  994.                         alert("setNormal>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  995.                 });
  996.         }

  997.         function kickMemberFromChatRoom() {
  998.                 demo.kickMemberFromChatRoom({
  999.                         roomId: '9769955',
  1000.                         userId: '10001',
  1001.                         reason: ''
  1002.                 }, function (ret, err) {
  1003.                         alert("kickMemberFromChatRoom>>" + JSON.stringify(ret) + "  " + JSON.stringify(err));
  1004.                 });
  1005.         }

  1006.         function addLocalVideo() {
  1007.                 demo.addLocalVideo({
  1008.                         rect: {
  1009.                                 x: 0,
  1010.                                 y: 0,
  1011.                                 w: 300,
  1012.                                 h: 200
  1013.                         },
  1014.                         scalingType: 1,
  1015.                 }, function (ret, err) {

  1016.                 });
  1017.         }
  1018. </script>

  1019. </html>
复制代码


您需要登录后才可以回帖 登录

本版积分规则