3

I followed the instructions on https://developers.google.com/+/hangouts/button to attempt to load a google hangout button.

Here is my code:

https://jsfiddle.net/7s460oa0/1/

<script src="https://apis.google.com/js/platform.js" async defer></script>
<div id="placeholder-div"></div>
<script>
gapi.hangout.render('placeholder-div', { 'render': 'createhangout' });
</script>

Strangely, however, I get the "gapi is not defined" error in my javascript console!

Am I doing something silly, or is the google hangouts button API broken?

LNA
  • 1,427
  • 3
  • 24
  • 37
  • sorry, didn't read properly - gapi isn't defined because you try to use it before the script is loaded - get rid of `async defer` or don't run your code until you can be sure that platform.js is loaded ... though, once you do that, `gapi.hangout` will be undefined, and I got no clue why – Jaromanda X Aug 08 '16 at 01:48
  • Same problem... This was working up until recently, now the hangout object is suddenly missing – yuttadhammo Aug 08 '16 at 11:13
  • 1
    Created an issue here: https://productforums.google.com/forum/?utm_medium=email&utm_source=footer#!msg/hangouts/xb_bxd88H9Q/iRIe3gLNBQAJ. An upvote would be appreciated! – LNA Aug 08 '16 at 17:36
  • Broken for us as well. Been using it for the past 5 months in an important piece of work. Will upvote. – Ryan-Neal Mes Aug 09 '16 at 01:08

0 Answers0