Revert recording file format changes

Change back to the old, non-modular recording file format. The new
method doesn't work reliably and there are existing recordings already
out there that we might want to handle.
This commit is contained in:
Pierre Ossman 2017-05-22 13:44:48 +02:00
parent aadcf47d6f
commit 7c1f1a9cef
1 changed files with 13 additions and 6 deletions

View File

@ -19,10 +19,17 @@ function loadFile() {
} }
message("Loading " + fname); message("Loading " + fname);
return import(`../recordings/${fname}#nocache`);
return new Promise(function (resolve, reject) {
var script = document.createElement("script");
script.onload = resolve;
script.onerror = reject;
document.body.appendChild(script);
script.src = "../recordings/" + fname;
});
} }
function enableUI(recording) { function enableUI() {
var iterations = WebUtil.getQueryVar('iterations', 3); var iterations = WebUtil.getQueryVar('iterations', 3);
document.getElementById('iterations').value = iterations; document.getElementById('iterations').value = iterations;
@ -33,14 +40,14 @@ function enableUI(recording) {
document.getElementById('mode1').checked = true; document.getElementById('mode1').checked = true;
} }
message("VNC_frame_data.length: " + recording.VNC_frame_data.length); message("VNC_frame_data.length: " + VNC_frame_data.length);
const startButton = document.getElementById('startButton'); const startButton = document.getElementById('startButton');
startButton.disabled = false; startButton.disabled = false;
startButton.addEventListener('click', start); startButton.addEventListener('click', start);
frames = recording.VNC_frame_data; frames = VNC_frame_data;
encoding = recording.VNC_frame_encoding; encoding = VNC_frame_encoding;
} }
const notification = function (rfb, mesg, level, options) { const notification = function (rfb, mesg, level, options) {
@ -171,4 +178,4 @@ function start() {
player.start(mode); player.start(mode);
} }
loadFile().then(enableUI).catch(message); loadFile().then(enableUI).catch(function (e) { message("Error loading recording"); });