mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 14:41:21 +00:00
GUACAMOLE-377: Add JavaScript API support for tracking display render statistics.
This commit is contained in:
@@ -840,6 +840,12 @@ Guacamole.Client = function(tunnel) {
|
||||
* @event
|
||||
* @param {!number} timestamp
|
||||
* The timestamp associated with the sync instruction.
|
||||
*
|
||||
* @param {!number} frames
|
||||
* The number of frames that were considered or combined to produce the
|
||||
* frame associated with this sync instruction, or zero if this value
|
||||
* is not known or the remote desktop server provides no concept of
|
||||
* frames.
|
||||
*/
|
||||
this.onsync = null;
|
||||
|
||||
@@ -1530,6 +1536,7 @@ Guacamole.Client = function(tunnel) {
|
||||
"sync": function(parameters) {
|
||||
|
||||
var timestamp = parseInt(parameters[0]);
|
||||
var frames = parameters[1] ? parseInt(parameters[1]) : 0;
|
||||
|
||||
// Flush display, send sync when done
|
||||
display.flush(function displaySyncComplete() {
|
||||
@@ -1547,7 +1554,7 @@ Guacamole.Client = function(tunnel) {
|
||||
currentTimestamp = timestamp;
|
||||
}
|
||||
|
||||
});
|
||||
}, timestamp, frames);
|
||||
|
||||
// If received first update, no longer waiting.
|
||||
if (currentState === STATE_WAITING)
|
||||
@@ -1555,7 +1562,7 @@ Guacamole.Client = function(tunnel) {
|
||||
|
||||
// Call sync handler if defined
|
||||
if (guac_client.onsync)
|
||||
guac_client.onsync(timestamp);
|
||||
guac_client.onsync(timestamp, frames);
|
||||
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user