Google+ Hangouts API

gapi.hangout.av

Provides ability to control Hangout microphones, cameras, speakers and volume levels.

Classes

Functions

Events

Classes in gapi.hangout.av

Class Description
class CameraMuteEvent(
  isCameraMute
)
Contains information about the muting of the video from the local camera.
isCameraMute : boolean
Indicates whether the local participant is sending video.
class HasCameraEvent(
  hasCamera
)
Contains information about the local camera being activated.
hasCamera : boolean
Indicates whether the local participant's camera is activated.
class HasMicrophoneEvent(
  hasMicrophone
)
Contains information about the activation of the local microphone.
hasMicrophone : boolean
Indicates whether the local participant's microphone is activated.
class HasSpeakersEvent(
  hasSpeakers
)
Contains information about the activation of the local audio speakers.
hasSpeakers : boolean
Indicates whether the local participant's audio speakers are activated.
class LocalAudioNotificationsMuteChangedEvent(
  areNotificationsMuted
)
An event fired when localAudioNotificationsMute is changed.
areNotificationsMuted : boolean
Whether notifications are muted for the local participant. See gapi.hangout.av.setLocalAudioNotificationsMute for the types of sounds that will be muted.
class LocalParticipantVideoMirroredChangedEvent(
  isMirrored
)
Contains information about whether the video for the local participant appears mirrored for the local participant.
isMirrored : boolean
Whether the video of the local participant appears mirrored for the local participant.
class MicrophoneMuteEvent(
  isMicrophoneMute
)
Contains information about muting the local microphone.
isMicrophoneMute : boolean
Indicates whether the local participant's microphone is muted.
class VolumesChangedEvent(
  volumes
)
Contains information about changes to the volumes of participants.
volumes : Object.<string, number>
The volume level for each participant, keyed by participant ID. The volume is a number from 0 to 5, inclusive.

Functions in gapi.hangout.av

Function Returns Description & Parameter
clearAvatar(
  participantId
)
undefined Removes avatar image displayed over the video feed.

See also: gapi.hangout.av.setAvatar


participantId : string
The ID of the participant.
areLocalAudioNotificationsMuted() undefined Gets whether audio notifications are muted for the local participant. See gapi.hangout.av.setLocalAudioNotificationsMute for details on what types of sounds are muted.
getParticipantAudioLevel(
  participantId
)
Array.<number> Gets the audio level for a participant as set by setParticipantAudioLevel. Returns a two-element array where the first element is the level of the left audio channel and the second element is the level of the right audio channel.
participantId : string
The ID of the participant.
getAvatar(
  participantId
)
string Gets the URL for the avatar image for the given participant. Returns undefined if no avatar image is set for the participant.
participantId : string
The ID of the participant.
getCameraMute() boolean Returns true if the local participant's camera is currently sending video, false otherwise.
getMicrophoneMute() boolean Returns true if the microphone is muted for the local participant, false otherwise.
getParticipantVolume(
  participantId
)
number Gets the current audio volume for the given participant, a number from 0 to 5, inclusive.
participantId : string
The ID of the participant.
getVolumes() Object.<string, number> Gets the current audio volume level for all participants. Returns an object with key/value pairs where the key is the participant ID and the value is the volume for that participant. The volume is a number from 0 to 5, inclusive.
hasCamera() boolean Returns true if the local participant has an active camera, false otherwise.
hasMicrophone() boolean Returns true if the local participant has a working mic, false otherwise.
hasSpeakers() boolean Returns true if the local participant has working audio speakers, false otherwise.
isLocalParticipantVideoMirrored() boolean Returns true if the video of the local participant appears mirrored to the local participant, false otherwise.
isParticipantAudible(
  participantId
)
boolean Returns true if the participant's audio is muted for the local participant, false otherwise.

See also: gapi.hangout.av.setParticipantAudible


participantId : string
The ID of a participant.
isParticipantVisible(
  participantId
)
boolean Returns true if the participant's video is muted for the local participant, false otherwise.

See also: gapi.hangout.av.setParticipantVisible


participantId : string
The ID of a participant.
muteParticipantMicrophone(
  participantId
)
undefined Mutes a participant's microphone.
participantId : string
The ID of a participant.
requestParticipantMicrophoneMute(
  participantId
)
undefined
Deprecated:
Use gapi.hangout.av.muteParticipantMicrophone instead.
Prompts the participant to mute their audio.
participantId : string
The ID of a participant.
setLocalAudioNotificationsMute(
  areNotificationsMuted
)
undefined Sets whether audio notifications are muted for the local participant. Sounds include other users joining and departing, ringing telephone calls, and all other audio originating from the Hangout itself (as opposed to audio originating from participants). Sound effects will not be muted.
areNotificationsMuted : boolean
Whether notifications are muted for the local participant.
setLocalParticipantVideoMirrored(
  mirrored
)
undefined Sets whether the local participant's video appears mirrored to the local participant. By default, the video appears mirrored.
mirrored : boolean
True if the local participant's video is to be mirrored.
setParticipantAudioLevel(
  participantId,
  audioLevel
)
undefined Sets the audio level of a participant as heard by only the local participant. The audio level for a participant is in the range 0-10 with 1 being the default, a number from 0 to 1 indicating that the audio should be quieter than the default and a number from 1 to 10 indicating that the audio should be louder than the default. The audio level can also be set independently for the right and left audio channels.
participantId : string
The ID of a participant.
audioLevel : number|Array.<number>
Either a single number indicating the audio level that should be set for both the right and left channels, or an array whose first element is the level for the left audio channel and second element is the level for the right audio channel.
setAvatar(
  participantId,
  imageUrl
)
undefined Shows an image over the video feed for a participant. Note this affects only the view seen by the local participant. The other participants in the Hangout will still see the video feed for the given participant.
participantId : string
The ID of a participant.
imageUrl : string
The URL of an image to show over the video feed for the given participant.
setCameraMute(
  muted
)
undefined Starts or stops the local participant from sending video to the other Hangout participants.
muted : boolean
True if the local participant should stop sending video.
clearCameraMute() undefined Reverts the camera mute state to the last state set by the local participant.
setMicrophoneMute(
  muted
)
undefined Mutes or unmutes the microphone for the local participant.
muted : boolean
True if the local participant should be muted.
clearMicrophoneMute() undefined Reverts the microphone mute state to the last state set by the local participant.
setParticipantAudible(
  participantId,
  audible
)
undefined Sets the mute state of a participant as heard by only the local participant.
participantId : string
The ID of a participant.
audible : boolean
Indicates whether the given participant's audio should be heard by the local participant.
setParticipantVisible(
  participantId,
  visible
)
undefined Sets the visibility state of a participant as viewed by only the local participant.
participantId : string
The ID of a participant.
visible : boolean
True if the given participant should be visible to the local participant.

Event Functions in gapi.hangout.av

Event Function Description
gapi.hangout.av.onCameraMute
onCameraMute.add(
  callback
)
Adds a callback to be called when the local participant starts or stops sending video.
callback : function(CameraMuteEvent)
The callback to add.
onCameraMute.remove(
  callback
)
Removes a callback previously added by onCameraMute.add.
callback : function(CameraMuteEvent)
The callback to remove.
gapi.hangout.av.onHasCamera
onHasCamera.add(
  callback
)
Adds a callback to be called when the local participant activates or deactivates their camera. "Activate" means the camera is connected and available (whether muted or not muted).
callback : function(HasCameraEvent)
The callback to add.
onHasCamera.remove(
  callback
)
Removes a callback previously added by onHasCamera.add.
callback : function(HasCameraEvent)
The callback to remove.
gapi.hangout.av.onHasMicrophone
onHasMicrophone.add(
  callback
)
Adds a callback to be called when the local participant activates or deactivates their mic. "Activate" means the microphone is connected and available (whether muted or not muted).
callback : function(HasMicrophoneEvent)
The callback to add.
onHasMicrophone.remove(
  callback
)
Removes a callback previously added by onHasMicrophone.add.
callback : function(HasMicrophoneEvent)
The callback to remove.
gapi.hangout.av.onHasSpeakers
onHasSpeakers.add(
  callback
)
Adds a callback to be called when the local participant activates or deactivates their audio speakers. "Activate" means the speakers are connected and available (whether the volume is turned up or down).
callback : function(HasSpeakersEvent)
The callback to add.
onHasSpeakers.remove(
  callback
)
Removes a callback previously added by onHasSpeakers.add.
callback : function(HasSpeakersEvent)
The callback to remove.
gapi.hangout.av.onLocalAudioNotificationsMuteChanged
onLocalAudioNotificationsMuteChanged.add(
  callback
)
Adds a callback to be called when the localAudioNotificationsMute changes.
callback : function(LocalAudioNotificationsMuteChangedEvent)
The callback to add.
onLocalAudioNotificationsMuteChanged.remove(
  callback
)
Removes a callback previously added by gapi.hangout.av.onLocalAudioNotificationsMuteChanged.add.
callback : function(LocalAudioNotificationsMuteChangedEvent)
The callback to remove.
gapi.hangout.av.onLocalParticipantVideoMirroredChanged
onLocalParticipantVideoMirroredChanged.add(
  callback
)
Adds a callback to be called when the mirrored state of the local participant's video changes.
callback : function(LocalParticipantVideoMirroredChangedEvent)
The callback to add.
onLocalParticipantVideoMirroredChanged.remove(
  callback
)
Removes a callback previously added by onLocalParticipantVideoMirroredChanged.add.
callback : undefined
gapi.hangout.av.onMicrophoneMute
onMicrophoneMute.add(
  callback
)
Adds a callback to be called when the microphone mute state for the local participant changes.
callback : function(MicrophoneMuteEvent)
The callback to add.
onMicrophoneMute.remove(
  callback
)
Removes a callback previously added by onMicrophoneMute.add.
callback : function(MicrophoneMuteEvent)
The callback to remove.
gapi.hangout.av.onVolumesChanged
onVolumesChanged.add(
  callback
)
Adds a callback to be called when the audio volume levels at the source changes for any participant. The argument to the callback is an event that holds the new volume levels for all participants.
callback : function(VolumesChangedEvent)
The callback to add.
onVolumesChanged.remove(
  callback
)
Removes a callback previously added by onVolumesChanged.add.
callback : function(VolumesChangedEvent)
The callback to remove.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.