GUACAMOLE-346: Always replay frames asynchronously when seeking.

This commit is contained in:
Michael Jumper
2017-07-15 16:06:32 -07:00
parent 1d6e8d2216
commit 744574d026

View File

@@ -315,11 +315,10 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) {
/**
* Moves the playback position to the given frame, resetting the state of
* the playback client and replaying frames as necessary. If the seek
* cannot be completed quickly, the seek operation may proceed
* asynchronously. If a seek operation is already in progress, that seek is
* first aborted. The progress of the seek operation can be observed
* through the onseek handler and the provided callback.
* the playback client and replaying frames as necessary. The seek
* operation will proceed asynchronously. If a seek operation is already in
* progress, that seek is first aborted. The progress of the seek operation
* can be observed through the onseek handler and the provided callback.
*
* @private
* @param {Number} index
@@ -358,6 +357,9 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) {
// Advance to frame index after current state
startIndex++;
// Replay frames asynchronously
seekTimeout = window.setTimeout(function continueSeek() {
var startTime = new Date().getTime();
// Replay any applicable incremental frames
@@ -380,9 +382,7 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) {
// If the seek operation has not yet completed, schedule continuation
if (currentFrame !== index)
seekTimeout = window.setTimeout(function continueSeek() {
seekToFrame(index, callback);
}, 0);
else {
@@ -392,6 +392,8 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) {
}
}, 0);
};
/**
@@ -598,8 +600,7 @@ Guacamole.SessionRecording = function SessionRecording(tunnel) {
* 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. Depending on how much processing
* the seek operation requires, the seek operation may proceed
* progress, that seek is first aborted. The seek operation will proceed
* asynchronously.
*
* @param {Number} position