jmuehlner commented on code in PR #883:
URL: https://github.com/apache/guacamole-client/pull/883#discussion_r1221963793
##########
guacamole-common-js/src/main/webapp/modules/SessionRecording.js:
##########
@@ -139,22 +146,60 @@ Guacamole.SessionRecording = function
SessionRecording(source) {
var currentFrame = -1;
/**
- * The timestamp of the frame when playback began, in milliseconds. If
- * playback is not in progress, this will be null.
+ * True if the player is currently playing, or false otherwise.
*
* @private
- * @type {number}
+ * @type {boolean}
+ */
+ var currentlyPlaying = null;
+
+ /**
+ * The current position within the recording, in milliseconds.
+ *
+ * @private
+ * @type {!number}
+ */
+ var currentPosition = 0;
+
+ /**
+ * Updates the position of the recording if it's playing, incrementing the
+ * value by the provided refreshInterval, and calling the onseek handler
+ * with the new value, if a handler was was provided.
*/
- var startVideoTimestamp = null;
+ function refreshPosition() {
Review Comment:
I originally implemented this with the interval happening in the recording
player in the angular app (`player.js` below) but it was a mess. Having to keep
multiple different sources of truth led to a lot of potential inconsistency,
with issues like the interval advancing the position in the player past the
start of the next frame, leading to a jittering progress bar.
Keeping the source of truth inside the recording itself allows for easy
checking to make sure that the position monotonically increases during
playback, with no weird behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]