Cobrowse Agent Events

Events

Agent Events are the events included within the agent side behavior of Cobrowse, in alphabetical order:

accessdenied

The accessdenied method means the agent attempted to use a Glance feature without the appropriate privilege. The object passed to the event handler describes the access violation.

It may include the rcrequested property when an agent requested remote control without having the remote-control privilege.

addguestaccepted

The addguestaccepted event fires when the visitor grants permission to add a guest.

{  
agentnum: <agent number>
token: <guest admit token>
}    

addguestdeclined

The addguestdeclined event fires when the visitor denies permission to add a guest.

agents

The agents event announces agents joining or leaving the session. See the visitor-side agents event for more information.

connectfailed

The connectfailed event occurs if the viewer is unable to connect to the Cobrowse service.

{ detail: <message indicating the reason for connect failure> }

documentShared

Information about document sharing.

{"sharedBy": "visitor|agent", "name": "name.xyz" }

documentDownloaded

Information about the files downloaded from document sharing.

{"sharedBy": "visitor|agent", "downloadedBy": "visitor|agent","name": "name.xyz" }

enddocshare

The enddocshare event occurs when document sharing has ended.

enddocsharepreview

The enddocsharepreview event occurs when the preview for document sharing has ended.

The navigate event occurs when a visitor navigates to a new page. The object passed to the event handler includes information about the browser and URL.

pagevisibility

The pagevisibility event occurs when the visitor’s page visibility is changed by opening a new tab, minimizing the window, or returning the page. It can have a value of visible or hidden.

rc

The rc event occurs when the remote control state changes. The enabled property of the object indicates whether remote control is currently enabled. The suspended property indicates whether control is temporarily suspended due to visitor mouse or keyboard activity. See the visitor side rc event for more information.

{  enabled : [true | false],
   suspended : [true | false]}    

rcrequest

The rcrequest event occurs when the visitor responds to a request for remote control. The object passed to the event handler shows whether the visitor accepted or declined the request.

{response:["accepted" | "declined"]}    

sessionend

The sessionend event occurs when the session ends. The object passed to the event handler may be undefined, or may contain a reason code. See reason codes.

{msg : [a description of the error]}    

sessionpaused

A session posts sessionpaused when the session is paused or unpaused. It includes an object describing the current state of the session. It will include the message displayed to the agent, if one is provided.

{paused: true|false[, message: '']}

screenshare

The screenshare event occurs on the agent side when a visitor accepts, declines, joins, or ends a Screen Share session. The object passed to the event handler shows the view and the state of the screenshare session.

{screenshareView : "[glance_agentvideo|glance_screenshare]",
 state: "[accepted|declined|joined|ended]"
}

screensharedeclined

The screensharedeclined event occurs when an agent sends a request to the visitor to share their screen but the visitor declines.

startdocshare

The startdocshare event occurs when document sharing has started.

startdocsharepreview

The startdocsharepreview event occurs when the preview for document sharing has started.

userstate

The userstate event occurs whenever the visitor side sets user state by calling the GLANCE.Cobrowse.Visitor.setUserState() method. It includes the user state object passed into that method call on the user side.

viewerclosing

The viewerclosing event occurs when participants in a multiway video session are unable to play videos due to their browser/network.

{ closereason: "PlayerTooSlow"}

visitorscreensharenotsupported

The visitorscreensharenotsupported event occurs when the visitor’s environment does not support clientless screenshare (e.g. visitor is on a mobile device).

visitorscreensharestarted

The visitorscreensharestarted event occurs when the visitor accepts a screen share request and starts sharing their screen

visitorscreensharestopped

The visitorscreensharestopped event occurs when a visitor or agent ends the visitor’s screenshare.

visitorvideorequest

The visitor has responded to a request to turn on video.accepted or declined.

visitorvideorequested

The visitorvideorequested event occurs when the agent requests to add video to a session when the participants include a guest.

visitorvideo

Information about the visitor video session

{ agentviewerelementid: [id of the element where visitor video should be displayed],
  camerastatus: ["available"|"blocked"|"nocamera"|"error"],
  descriptor : [internal use only],
  paused : [true|false],
  previewelementid [id of the element containing the visitor's video preview],
  sessionkey : [], video: [small|large]
}

visitorvideo occurs when the visitor’s video session first starts, and again if there is a change in the video session state.

Session End Reason Codes

Error Reason
UnsupportedBrowser Agent’s browser is not supported for Cobrowse.
SSOError SSO authentication failed.
NoSession Session Key is invalid or the session has not started yet.
InvalidCobrowseSub Authenticated user does not have a valid subscription for viewing Cobrowse sessions.
ExpiredCreditCard Credit card on the account has expired.
DeclinedInvoice Credit card for the account was declined.
ConnDrop Agent’s connection to the Glance Cobrowse server dropped.
AgentRefresh Agent refreshed the browser.
AuthError Authentication with the Cobrowse service failed.
LookupFailed Agent was unable to connect to the Glance web service to lookup the session.
VisitorLeft Visitor left the session.
AgentLeft Agent left the session. If the agent was the last agent in the session, the session ends.