What is the right way to listen for changes on Google+ in Hangouts?

The Hangouts API at https://developers.google.com/+/hangouts/writing shows an example of setting a callback function when the state of a video call changes, for example:

gapi.hangout.onStateChanged.add(onStateChange);

On startup, this results in an error similar to " gapi.hangout.onStateChanged undefined ". A quick check of Firebug shows that the method does notonStateChanged belong .gapi.hangout.data gapi.hangout

What is the correct way to add a callback function when a state changes?

+3
source share
1 answer

, , gapi.hangout.data. , , . :)

-, :

gapi.hangout.data.onStateChanged.add(function() {
  console.log(gapi.hangout.data.getState());
});

.

+2

All Articles