Google + hangout button

故事扮演 提交于 2019-12-14 04:19:41

问题


I am trying to add a google hangout button to my html file as shown below but when I run the html page , the button does not show.

<!DOCTYPE html>
<html>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div id="placeholder-rr"></div>
<script>
  gapi.hangout.render('placeholder-rr', {
    'render': 'createhangout',
    'initial_apps': [{'app_id' : '184219133185', 'start_data' : 'dQw4w9WgXcQ',     'app_type' : 'ROOM_APP' }],
    'widget_size': 175
    });
     </script>
</html>

回答1:


  • First please check if any errors showing up in browser console using f12 key when on browser and reload the page.

  • Try adding this script as well alongwith platform.js to the page you want the hangout button. <script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>

Hope this helps

Example code:-

<div id="hangout-button-holder"></div>
<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script>
$(document).ready(function(){

gapi.hangout.render('hangout-button-holder', { 'render': 'createhangout', 'topic': 'Its a demo app dont freak out', 'hangout_type': 'onair', 'initial_apps': [{'app_id' : 'xxxxxxxxxxx', 'start_data' : 'dQw4w9WgXcQ', 'app_type' : 'LOCAL_APP' }],
    'widget_size': 175 });
});

</script>


来源:https://stackoverflow.com/questions/29004114/google-hangout-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!