mike-jumper commented on code in PR #883:
URL: https://github.com/apache/guacamole-client/pull/883#discussion_r1228724468


##########
guacamole-common-js/src/main/webapp/modules/SessionRecording.js:
##########
@@ -684,14 +766,13 @@ Guacamole.SessionRecording = function 
SessionRecording(source) {
             // Pull the upcoming frame
             var next = frames[currentFrame + 1];
 
-            // Calculate the real timestamp corresponding to when the next
-            // frame begins
-            var nextRealTimestamp = next.timestamp - startVideoTimestamp + 
startRealTimestamp;
+            // Add the offset to the next frame timestamp to calculate the 
delay
+            var delay = toRelativeTimestamp(next.timestamp) - currentPosition;

Review Comment:
   > How do my latest changes look? That's more or less what I'm doing, though 
I didn't do do the multiple-of-`refreshInterval` thing, I just seek to the next 
`refreshInterval`, or the next frame, whichever is sooner.
   
   I think you might need to round down to the nearest 
multiple-of-`refreshInterval`. Seeking to the next `refreshInterval` would be 
relative to the current position, which may not be correct. For example 
(timestamps below are relative to start of recording):
   
   1. Frame at 0ms. Player shows "00:00".
   2. Frame at 400ms. Player shows "00:00".
   3. Frame at 10000ms. Player waits until current position + 
`refreshInterval`, showing "00:01" at 1400ms.
   
   Here, the player took 1.4 seconds of playback before the visible timestamp 
progressed from "00:00" to "00:01". If this sort of issue occurred multiple 
times in the recording, it would appear to the user as a jittering playback 
timestamp, incrementing at inconsistent intervals.
   
   With rounding down to the nearest multiple of `refreshInterval`, we instead 
get:
   
   1. Frame at 0ms. Player shows "00:00".
   2. Frame at 400ms. Player shows "00:00".
   3. Frame at 10000ms. Player waits until the nearest multiple of 
`refreshInterval`, showing "00:01" at 1000ms.



-- 
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]

Reply via email to