mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-896: Merge leverage Blobs for storage of recording keyframes.
This commit is contained in:
@@ -548,7 +548,7 @@ Guacamole.SessionRecording = function SessionRecording(source) {
|
|||||||
// Store client state if frame is flagged as a keyframe
|
// Store client state if frame is flagged as a keyframe
|
||||||
if (frame.keyframe && !frame.clientState) {
|
if (frame.keyframe && !frame.clientState) {
|
||||||
playbackClient.exportState(function storeClientState(state) {
|
playbackClient.exportState(function storeClientState(state) {
|
||||||
frame.clientState = state;
|
frame.clientState = new Blob([JSON.stringify(state)]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -606,8 +606,10 @@ Guacamole.SessionRecording = function SessionRecording(source) {
|
|||||||
// If frame has associated absolute state, make that frame the
|
// If frame has associated absolute state, make that frame the
|
||||||
// current state
|
// current state
|
||||||
if (frame.clientState) {
|
if (frame.clientState) {
|
||||||
playbackClient.importState(frame.clientState);
|
frame.clientState.text().then(function textReady(text) {
|
||||||
currentFrame = index;
|
playbackClient.importState(JSON.parse(text));
|
||||||
|
currentFrame = index;
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1058,10 +1060,12 @@ Guacamole.SessionRecording._Frame = function _Frame(timestamp, start, end) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A snapshot of client state after this frame was rendered, as returned by
|
* A snapshot of client state after this frame was rendered, as returned by
|
||||||
* a call to exportState(). If no such snapshot has been taken, this will
|
* a call to exportState(), serialized as JSON, and stored within a Blob.
|
||||||
* be null.
|
* Use of Blobs here is required to ensure the browser can make use of
|
||||||
|
* larger disk-backed storage if the size of the recording is large. If no
|
||||||
|
* such snapshot has been taken, this will be null.
|
||||||
*
|
*
|
||||||
* @type {object}
|
* @type {Blob}
|
||||||
* @default null
|
* @default null
|
||||||
*/
|
*/
|
||||||
this.clientState = null;
|
this.clientState = null;
|
||||||
|
Reference in New Issue
Block a user