dongzhuohan7085 2013-11-28 04:43
浏览 15

在php应用程序和接收器中集成的vLine视频聊天不会接到任何电话

I have successfully tested the vline-node example locally but when i uploaded my code into server and my user is able to call the other person but at the other end user is unable to receive any call because there is no call to receive. i am using this script which i downloaded from GitHub. The link used in vline examples

https://github.com/vline/vline-php-example

Help me out of it if you used this. thanks

  var client, vlinesession,
    authToken = '<?php echo $vline->getJWT() ?>',
    serviceId = '<?php echo $vline->getServiceID() ?>',
    profile = {"displayName": '<?php echo $vline->getUserDisplayName() ?>', "id": '<?php echo $vline->getUserID() ?>'};

  // Create vLine client  
  window.vlineClient = client = vline.Client.create({"serviceId": serviceId, "ui": true});
  // Add login event handler
  client.on('login', onLogin);
  // Do login


  client.login(serviceId, profile, authToken);


  function onLogin(event) {
    vlinesession = event.target;
    // Find and init call buttons and init them
    $(".callbutton").each(function(index, element) {
       initCallButton($(this)); 
    });
  }

  // add event handlers for call button
  function initCallButton(button) {
    var userId = button.attr('data-userid');

    // fetch person object associated with username
    vlinesession.getPerson(userId).done(function(person) {
      // update button state with presence
      function onPresenceChange() {
        if(person.getPresenceState() == 'online'){
            button.removeClass().addClass('active');
        }else{
            button.removeClass().addClass('disabled');
        }
        button.attr('data-presence', person.getPresenceState());
      }

      // set current presence
      onPresenceChange();

      // handle presence changes
      person.on('change:presenceState', onPresenceChange);

      // start a call when button is clicked
      button.click(function() {
              if (person.getId() == vlinesession.getLocalPersonId()) {
            alert('You cannot call yourself. Login as another user in an incognito window');
            return;
              }
          if(button.hasClass('active'))
            person.startMedia();
      });
    });

  }

  return client;
})();

$(window).unload(function() {
  vlineClient.logout();
});
</script>`
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于squad数据集的基于bert模型的微调
    • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
    • ¥20 steam下载游戏占用内存
    • ¥15 CST保存项目时失败
    • ¥15 树莓派5怎么用camera module 3啊
    • ¥20 java在应用程序里获取不到扬声器设备
    • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
    • ¥15 Attention is all you need 的代码运行
    • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
    • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: