An admin token returned from the REST API that will grant this user access to managing user permissions and programmatic navigation.
Number of milliseconds until the request to the virtual browser times out. If the request times out, the returned promise will be rejected.
Starting volume of the virtual browser.
Starting video pause state of the virtual browser.
Starting playout delay state of the virtual browser. When playoutDelay
= true
, input lag increases but smoothness is improved and frame drops are reduced.
Delegate global keyboard events to the embed.
Data to be provided to your webhook endpoint if you’re using webhook authentication.
frameCb
(frame: ImageBitmap | HTMLVideoElement) => void
Callback called with the virtual computer’s video frame data. For Chromium-based browsers, its type is ImageBitmap
. For other browsers, it’s an HTMLVideoElement
. Most frameworks like Three.js and Babylon.js can handle both types automatically.
audioTrackCb
(track: MediaStreamTrack) => void
Callback called with a MediaStreamTrack
of the virtual computer’s audio stream.
onCursor
(e: PeerMouseEvent) => void
Callback called when another user moves their mouse cursor on top of the virtual browser. Useful for implementing multiplayer cursors.
onDisconnect
(e: DisconnectEvent) => void
Callback called when the user disconnects from the virtual browser. e.type
is an enum with one of the following values:
"request"
-> virtual browser was manually shut down.
"inactive"
-> inactive timeout was triggered.
"absolute"
-> absolute timeout was triggered.
"kick"
-> user was kicked from the session.
onCloseWarning
(e: CloseWarningEvent) => void
Callback called when a timeout either surpasses the warning threshold, or has been reset and is no longer passed the warning threshold.
e.type
is an enum that refers to the timeout’s type tied to the event. Possible values are "inactive"
and "absolute"
.
e.deadline
= null | { delay: number, closeDate: string }
. If e.deadline
is null
, then the timeout was reset and is no longer passed the warning threshold. If e.deadline
is set, e.deadline.delay
is the number of milliseconds until the timeout is triggered, and e.deadline.closeDate
is an RFC3339 formatted string of when the timeout will occur.
onConnectionStateChange
(e: ConnectionStateEvent) => void
Callback called when the connection state of the video stream has changed. e.state
= "connecting" | "playing" | "reconnecting"
.
You can use this to show custom reconnecting UI, and detecting if a user has a sub-optimal connection to the virtual browser.