Links

Events

Both the client and session emit events and can be listened to using .on(event, callback)

Client

Event
Type
Description
queue
Record<string, any>
Your position in queue for the device. If type is account you have reached the maximum amount of concurrent sessions for your account and are in queue for the next available slot. If type is session, you are in a queue to wait for the next available device.
error
string
An error has occurred
deviceInfo
Record<string, any>
Information about the current device, such as type, orientation, and screen dimensions. It also contains rendered dimensions of the device within the embed.
session
Session
A new session has started, either by client.startSession() or the user clicking "Tap to Play" on the device

Session

Event
Type
Description
log
{ message: string }
Debug log from the device Requires debug to be set to true
network
Record<string, any>
Intercepted network request or responses. Requires proxy to be set to intercept On Android the URLs will contain the resolved IP address instead of of the hostname. If you need the hostname, you can get it from the :authority header on the request.
error
string
An error has occurred on the session
action
Record<string, any>
An action has been recorded
interaction
Record<string, any>
Session received interaction from the user
inactivityWarning
{ secondsRemaining: number }
Session is about to timeout due to inactivity.
Any user interaction or a heartbeat will reset the timeout.
orientationChanged
'portrait' | 'landscape'
The device has changed orientation
video
{ buffer: Uint8Array, width: number, height: number, codec: string }
Video frames of the current session. When codec is h264, the buffer is a raw frame of the stream. These frames can be muxed (using something like jmuxer) to turn it into a video format. When codec is jpeg the buffers are jpeg images.
audio
{ buffer: Uint8Array, width: number, height: number, codec: 'aac' }
Audio frames of the current session. Like h264 with the video event, these can be muxed as well.