Commit efed2eea authored by Solly Ross's avatar Solly Ross

Fix up vnc_playback.html and playback.js

This commit fixes vnc_playback.html and playback.js
so that they work with the current version of noVNC.
parent bc4414f5
...@@ -12,19 +12,36 @@ var rfb, mode, test_state, frame_idx, frame_length, ...@@ -12,19 +12,36 @@ var rfb, mode, test_state, frame_idx, frame_length,
iteration, iterations, istart_time, iteration, iterations, istart_time,
// Pre-declarations for jslint // Pre-declarations for jslint
send_array, next_iteration, queue_next_packet, do_packet; send_array, next_iteration, queue_next_packet, do_packet, enable_test_mode;
// Override send_array // Override send_array
send_array = function (arr) { send_array = function (arr) {
// Stub out send_array // Stub out send_array
}; };
enable_test_mode = function () {
rfb._sock._mode = VNC_frame_encoding;
rfb._sock.send = send_array;
rfb._sock.close = function () {};
rfb._sock.flush = function () {};
rfb._checkEvents = function () {};
rfb.connect = function (host, port, password, path) {
this._rfb_host = host;
this._rfb_port = port;
this._rfb_password = (password !== undefined) ? password : "";
this._rfb_path = (path !== undefined) ? path : "";
this._updateState('ProtocolVersion', "Starting VNC handshake");
};
};
next_iteration = function () { next_iteration = function () {
rfb = new RFB({'target': $D('VNC_canvas'),
'onUpdateState': updateState});
enable_test_mode();
if (iteration === 0) { if (iteration === 0) {
frame_length = VNC_frame_data.length; frame_length = VNC_frame_data.length;
test_state = 'running'; test_state = 'running';
} else {
rfb.disconnect();
} }
if (test_state !== 'running') { return; } if (test_state !== 'running') { return; }
...@@ -91,9 +108,9 @@ do_packet = function () { ...@@ -91,9 +108,9 @@ do_packet = function () {
for (var i = 0; i < frame.length - start; i++) { for (var i = 0; i < frame.length - start; i++) {
u8[i] = frame.charCodeAt(start + i); u8[i] = frame.charCodeAt(start + i);
} }
rfb.recv_message({'data' : u8}); rfb._sock._recv_message({'data' : u8});
} else { } else {
rfb.recv_message({'data' : frame.slice(start)}); rfb._sock._recv_message({'data' : frame.slice(start)});
} }
frame_idx += 1; frame_idx += 1;
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
if (fname) { if (fname) {
message("Loading " + fname); message("Loading " + fname);
// Load supporting scripts // Load supporting scripts
Util.load_scripts(["base64.js", "websock.js", "des.js", Util.load_scripts(["base64.js", "websock.js", "des.js", "keysym.js",
"keysymdef.js", "keyboard.js", "input.js", "display.js", "keysymdef.js", "keyboard.js", "input.js", "display.js",
"jsunzip.js", "rfb.js", "playback.js", fname]); "jsunzip.js", "rfb.js", "playback.js", fname]);
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
test_state = 'failed'; test_state = 'failed';
break; break;
case 'loaded': case 'loaded':
$D('startButton').disabled = false;
break; break;
} }
if (typeof msg !== 'undefined') { if (typeof msg !== 'undefined') {
...@@ -99,7 +98,8 @@ ...@@ -99,7 +98,8 @@
mode = 'realtime'; mode = 'realtime';
} }
recv_message = rfb.testMode(send_array, VNC_frame_encoding); //recv_message = rfb.testMode(send_array, VNC_frame_encoding);
next_iteration(); next_iteration();
} }
...@@ -130,9 +130,8 @@ ...@@ -130,9 +130,8 @@
} }
if (fname) { if (fname) {
message("VNC_frame_data.length: " + VNC_frame_data.length); message("VNC_frame_data.length: " + VNC_frame_data.length);
rfb = new RFB({'target': $D('VNC_canvas'),
'onUpdateState': updateState});
} }
$D('startButton').disabled = false;
} }
</script> </script>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment