new SessionRecording(tunnelnon-null)
A recording of a Guacamole session. Given a Guacamole.Tunnel, the
Guacamole.SessionRecording automatically handles incoming Guacamole
instructions, storing them for playback. Playback of the recording may be
controlled through function calls to the Guacamole.SessionRecording, even
while the recording has not yet finished being created or downloaded.
Parameters:
Name | Type | Description |
---|---|---|
tunnel |
Guacamole.Tunnel | The Guacamole.Tunnel from which the instructions of the recording should be read. |
Methods
connect(dataopt)
Connects the underlying tunnel, beginning download of the Guacamole
session. Playback of the Guacamole session cannot occur until at least
one frame worth of instructions has been downloaded.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
string |
<optional> |
The data to send to the tunnel when connecting. |
disconnect()
Disconnects the underlying tunnel, stopping further download of the
Guacamole session.
getDisplay() → (non-null) {Guacamole.Display}
Returns the underlying display of the Guacamole.Client used by this
Guacamole.SessionRecording for playback. The display contains an Element
which can be added to the DOM, causing the display (and thus playback of
the recording) to become visible.
Returns:
The underlying display of the Guacamole.Client used by this
Guacamole.SessionRecording for playback.
- Type
- Guacamole.Display
getDuration() → (non-null) {number}
Returns the duration of this recording, in milliseconds. If the
recording is still being downloaded, this value will gradually increase.
Returns:
The duration of this recording, in milliseconds.
- Type
- number
getPosition() → (non-null) {number}
Returns the current playback position within the recording, in
milliseconds, where zero is the start of the recording.
Returns:
The current playback position within the recording, in milliseconds.
- Type
- number
isPlaying() → (non-null) {boolean}
Returns whether playback is currently in progress.
Returns:
true if playback is currently in progress, false otherwise.
- Type
- boolean
pause()
Pauses playback of the recording, if playback is currently in progress.
If playback is not in progress, this function has no effect. If a seek
operation is in progress, the seek is aborted. Playback is initially
paused when a Guacamole.SessionRecording is created, and must be
explicitly started through a call to play().
play()
Begins continuous playback of the recording downloaded thus far.
Playback of the recording will continue until pause() is invoked or
until no further frames exist. Playback is initially paused when a
Guacamole.SessionRecording is created, and must be explicitly started
through a call to this function. If playback is already in progress,
this function has no effect. If a seek operation is in progress,
playback resumes at the current position, and the seek is aborted as if
completed.
seek(positionnon-null, callbackopt)
Seeks to the given position within the recording. If the recording is
currently being played back, playback will continue after the seek is
performed. If the recording is currently paused, playback will be
paused after the seek is performed. If a seek operation is already in
progress, that seek is first aborted. The seek operation will proceed
asynchronously.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
position |
number | The position within the recording to seek to, in milliseconds. | |
callback |
function |
<optional> |
The callback to invoke once the seek operation has completed. |
Events
onpause
Fired whenever playback of the recording has been paused. This may
happen when playback is explicitly paused with a call to pause(), or
when playback is implicitly paused due to reaching the end of the
recording.
onplay
Fired whenever playback of the recording has started.
onprogress
Fired when new frames have become available while the recording is
being downloaded.
Parameters:
Name | Type | Description |
---|---|---|
duration |
number | The new duration of the recording, in milliseconds. |
onseek
Fired whenever the playback position within the recording changes.
Parameters:
Name | Type | Description |
---|---|---|
position |
number | The new position within the recording, in milliseconds. |