how to get a hangout url from the hangout button

天涯浪子 提交于 2019-12-06 10:41:12

The answer is: In the gadget or xml file.

Nothing gets returned to your website that you render the button, it is all in the hangout itself. Pass a token in the start_data variable and then in the xml that launches the hangout, you will want to use that as the key in an ajax call back to your app along with any other gapi.hangout data you want associated with that initiated hangout.

var registerHangout = function() {
  var hangoutUrl = gapi.hangout.getHangoutUrl();
  var callbackUrl = 'http://yourwebsite.com/hangout_registration';
  var startData = gapi.hangout.getStartData();

  $.ajax({
    type: "POST",
    url: callbackUrl,
    success: successFunc,
    dataType: 'json',
    data: JSON.stringify({
            "hangoutUrl": hangoutUrl,
            "startData": startData
           })
  });
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!