Provides basic information such as the list of participants, the locale, and whether the app is initialized and visible.
- API Initialization
- onApiReady, isApiReady
- While all members of the gapi.hangout API will be available when your
application code begins to execute, the API might not be fully initialized.
Before initialization, the values returned by APIs might be unexpected
(undefined). Modifications ('set*') might produce unexpected results. Adding
event listeners before the API is initialized is possible, but the added
event listeners might be called while the rest of the API is in an
inconsistent state. We therefore strongly recommend delaying your application
startup until the Hangouts API is fully initialized, by calling your app with
something like this:
gapi.hangout.onApiReady.add(function(eventObj) { startMyApp(); });
Classes
- ApiReadyEvent
- AppVisibleEvent
- EnabledParticipantsChangedEvent
- Participant
- ParticipantsAddedEvent
- ParticipantsChangedEvent
- ParticipantsDisabledEvent
- ParticipantsEnabledEvent
- ParticipantsRemovedEvent
- PreferredLocaleChangedEvent
- PublicChangedEvent
- TopicChangedEvent
Functions
- getEnabledParticipants
- getHangoutUrl
- getHangoutId
- getLocale
- getLocalParticipantLocale
- getPreferredLocale
- getStartData
- getParticipantById
- getParticipantId
- getLocalParticipant
- getLocalParticipantId
- getParticipants
- getTopic
- hasAgeRestriction
- hideApp
- isApiReady
- isAppVisible
- isPublic
- setWillAutoLoad
- wasAutoLoaded
- willAutoLoad
Events
- onApiReady
- onAppVisible
- onAutoLoadChange
- onEnabledParticipantsChanged
- onParticipantsAdded
- onParticipantsChanged
- onParticipantsDisabled
- onParticipantsEnabled
- onParticipantsRemoved
- onPreferredLocaleChanged
- onPublicChanged
- onTopicChanged
Classes in gapi.hangout
| Class | Description |
|---|---|
class ApiReadyEvent(
|
Contains information about the API becoming ready.
|
class AppVisibleEvent(
|
Contains information about an an app becoming visible in a Hangout.
|
class EnabledParticipantsChangedEvent(
|
Contains information about participants running this app.
|
class Participant(
|
A Participant instance represents a person who has joined a Google Hangout. Hangout participant fields should not be modified. Each Participant has a person field which is similar to a subset of Google+ API person. You can get a list of all participants using getParticipants.
|
class ParticipantsAddedEvent(
|
Contains information about participants who have joined the event.
|
class ParticipantsChangedEvent(
|
Contains information about a change of participants joining or leaving
the hangout.
|
class ParticipantsDisabledEvent(
|
Contains information about participants who have stopped running this app.
|
class ParticipantsEnabledEvent(
|
Contains information about participants who have started running this app.
|
class ParticipantsRemovedEvent(
|
Contains information about participants who have left the Hangout.
|
class PreferredLocaleChangedEvent(
|
Contains information about a change to the Hangout's preferred locale.
|
class PublicChangedEvent(
|
Contains information about the Hangout becoming open to the public.
|
class TopicChangedEvent(
|
Contains information about the changing of a Hangout topic.
|
Functions in gapi.hangout
| Function | Returns | Description & Parameter |
|---|---|---|
getEnabledParticipants()
|
Array.<Participant>
|
Gets the participants who are running the app. |
getHangoutUrl()
|
string
|
Gets the URL for the hangout. Example URL: 'https://talkgadget.google.com/hangouts/_/1b8d9e10742f576bc994e18866ea' |
getHangoutId()
|
string
|
Gets an identifier for the Hangout guaranteed to be unique for the Hangout's
duration. The API makes no other guarantees about this identifier. Example of Hangout ID: 'muvc-private-chat-99999a93-6273-390d-894a-473226328d79@groupchat.google.com' |
getLocale()
|
string
|
Example: 'en' |
getLocalParticipantLocale()
|
string
|
Gets the locale for the local participant. Example: 'en' |
getPreferredLocale()
|
string
|
Gets the preferred locale for the Hangout. The user can set this
locale prior to starting a Hangout. It may differ from
gapi.hangout.getLocalParticipantLocale. Example: 'en' |
getStartData()
|
string
|
Gets the starting data for the current active app. This is the data passed in by the gd URL parameter (also available with gadgets.views.getParams). Returns null if no start data has been specified. |
getParticipantById(
|
Participant
|
Gets the participant with the given ID. Returns null if no participant
exists with the given ID.
|
getParticipantId()
|
string
|
Example: 'hangout65A4C551_ephemeral.id.google.com^354e9d1ed0' |
getLocalParticipant()
|
Participant
|
Gets the local participant. |
getLocalParticipantId()
|
string
|
Gets the ID of the local participant. A user is assigned a new ID each time
they join a Hangout. Example: 'hangout65A4C551_ephemeral.id.google.com^354e9d1ed0' |
getParticipants()
|
Array.<Participant>
|
Gets the participants in the Hangout. Note that the list of participants reflects the current state on the Hangouts server. There can be a small window of time where the local participant (returned from getParticipantId()) is not in the returned array. |
getTopic()
|
string
|
Returns the current Hangout topic, or an empty string if a topic was not specified. |
hasAgeRestriction()
|
boolean
|
Returns true if the Hangout is not open to minors, false if there are no age restrictions. |
hideApp()
|
|
Sets the app as not visible in the main Hangout window. The app will
continue to run while it is hidden. See also: gapi.hangout.onAppVisible |
isApiReady()
|
boolean
|
Returns true if the gapi.Hangout API is initialized; false otherwise. Before the API is initialized, data values might have unexpected values. |
isAppVisible()
|
boolean
|
Returns true if the app is visible in the main Hangout window, false otherwise. |
isPublic()
|
boolean
|
Returns true if the Hangout is open to the public, false otherwise. |
setWillAutoLoad(
|
|
Sets whether an application should start automatically at the beginning of
Hangouts. This should only be set by a user action, such as a checkbox in
a settings dialog box, rather than be done automatically. The user will be
notified and given a chance to cancel when an app sets itself to autoload.
|
wasAutoLoaded()
|
boolean
|
Returns whether this application was started automatically at the beginning of the Hangout. If the application was closed and re-opened, this will return false. |
willAutoLoad()
|
boolean
|
Returns whether this application will start automatically at the beginning of a Hangout. |
Event Functions in gapi.hangout
| Event Function | Description |
|---|---|
| gapi.hangout.onApiReady | |
onApiReady.add(
|
Adds a callback to be called when the gapi.hangout API becomes ready to use.
If the API is already initialized, the callback will be called at the next
event dispatch.
|
onApiReady.remove(
|
Removes a callback previously added by
onApiReady.add.
|
| gapi.hangout.onAppVisible | |
onAppVisible.add(
|
Adds a callback to be called when the app is shown or hidden. The argument to
the callback is an event that holds the state that indicates whether the app
is visible or not. See also: gapi.hangout.hideApp
|
onAppVisible.remove(
|
Removes a callback previously added by
onAppVisible.add.
|
| gapi.hangout.onAutoLoadChange | |
onAutoLoadChange.add(
|
Adds a callback to be called when the auto load setting for an application
has changed.
|
onAutoLoadChange.remove(
|
Removes a callback previously added by
onAutoLoadChange.add.
|
| gapi.hangout.onEnabledParticipantsChanged | |
onEnabledParticipantsChanged.add(
|
Adds a callback to be called whenever the set of participants who are running
this app changes. The argument to the callback is an event that holds all
participants who have enabled the app since the last time the event fired.
|
onEnabledParticipantsChanged.remove(
|
Removes a callback previously added by
onEnabledParticipantsChanged.add.
|
| gapi.hangout.onParticipantsAdded | |
onParticipantsAdded.add(
|
Adds a callback to be called whenever participants join the Hangout.
The argument to the callback is an event that holds the particpants
who have joined since the last time the event fired.
|
onParticipantsAdded.remove(
|
Removes a callback previously added by
onParticipantsAdded.add.
|
| gapi.hangout.onParticipantsChanged | |
onParticipantsChanged.add(
|
Adds callback to be called whenever there is any change in the participants
in the Hangout. The argument to the callback is an event that holds
holds the participants currently in the Hangout.
|
onParticipantsChanged.remove(
|
Removes a callback previously added by
onParticipantsChanged.add.
|
| gapi.hangout.onParticipantsDisabled | |
onParticipantsDisabled.add(
|
Adds a callback to be called whenever a participant stops running this app.
The argument to the callback is an event that holds the participants who
have stopped running this app since the last time the event fired.
|
onParticipantsDisabled.remove(
|
Removes a callback previously added by
onParticipantsDisabled.add.
|
| gapi.hangout.onParticipantsEnabled | |
onParticipantsEnabled.add(
|
Adds a callback to be called whenever a participant in the Hangout starts
running this app. The argument to the callback is an event that holds the set
of participants who have started running this app since the last time the
event fired.
|
onParticipantsEnabled.remove(
|
Removes a callback previously added by
onParticipantsEnabled.add.
|
| gapi.hangout.onParticipantsRemoved | |
onParticipantsRemoved.add(
|
Adds a callback to be called whenever participants leave the Hangout.
The argument to the callback is an event that holds the participants
who have left since the last time the event fired.
|
onParticipantsRemoved.remove(
|
Removes a callback previously added by
onParticipantsRemoved.add.
|
| gapi.hangout.onPreferredLocaleChanged | |
onPreferredLocaleChanged.add(
|
Adds a callback to be called when the Hangout's preferred locale changes.
|
onPreferredLocaleChanged.remove(
|
Removes a callback previously added by
onPreferredLocaleChanged.add.
|
| gapi.hangout.onPublicChanged | |
onPublicChanged.add(
|
Adds a callback to be called when the Hangout becomes public.
A Hangout can change only from private to public.
|
onPublicChanged.remove(
|
Removes a callback previously added by
onPublicChanged.add.
|
| gapi.hangout.onTopicChanged | |
onTopicChanged.add(
|
Adds a callback function to be called when the Hangout topic changes.
|
onTopicChanged.remove(
|
Removes a callback function that was previously added by
onTopicChanged.add.
|