]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Update vnc_playback.html to follow current API
authorPierre Ossman <ossman@cendio.se>
Fri, 26 Jan 2018 10:07:14 +0000 (11:07 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 26 Jan 2018 10:07:14 +0000 (11:07 +0100)
We had tried to update this along the way, but a bunch of things
were overlooked. Should be fully functional again now.

tests/playback-ui.js
tests/playback.js
tests/vnc_playback.html

index 01ad241e9ca12526f84b144468b82845a8eb0e0c..a23b7faeca939ddcdc2e1d981c95fe9cf32e2260 100644 (file)
@@ -115,7 +115,7 @@ IterationPlayer.prototype = {
         this._nextIteration();
     },
 
-    _disconnected: function (rfb, clean, frame) {
+    _disconnected: function (clean, frame) {
         if (!clean) {
             this._state = 'failed';
         }
@@ -123,6 +123,7 @@ IterationPlayer.prototype = {
         var evt = new Event('rfbdisconnected');
         evt.clean = clean;
         evt.frame = frame;
+        evt.iteration = this._iteration;
 
         this.onrfbdisconnected(evt);
     },
@@ -149,7 +150,7 @@ function start() {
         message(`Iteration ${evt.number} took ${evt.duration}ms`);
     };
     player.onrfbdisconnected = function (evt) {
-        if (evt.reason) {
+        if (!evt.clean) {
             message(`noVNC sent disconnected during iteration ${evt.iteration} frame ${evt.frame}`);
         }
     };
index c769e88fc2d234d06b6d20edc2e51c51d526a155..961cac3c162fb3a8660038e96b31684e8f91b4e5 100644 (file)
@@ -76,7 +76,7 @@ export default function RecordingPlayer (frames, encoding, disconnected) {
 RecordingPlayer.prototype = {
     run: function (realtime, trafficManagement) {
         // initialize a new RFB
-        this._rfb = new RFB(document.getElementById('VNC_canvas'), 'wss://test');
+        this._rfb = new RFB(document.getElementById('VNC_screen'), 'wss://test');
         this._rfb.viewOnly = true;
         this._rfb.addEventListener("disconnect",
                                    this._handleDisconnect.bind(this));
@@ -99,9 +99,9 @@ RecordingPlayer.prototype = {
         this._rfb._sock.send = function (arr) {};
         this._rfb._sock.close = function () {};
         this._rfb._sock.flush = function () {};
-        this._rfb._checkEvents = function () {};
-        this._rfb._connect = function () {
-            this._sock.init('binary', 'ws');
+        this._rfb._sock.open = function () {
+            this.init();
+            this._eventHandlers.open();
         };
     },
 
@@ -187,8 +187,8 @@ RecordingPlayer.prototype = {
         }
     },
 
-    _handleDisconnect(rfb, clean) {
+    _handleDisconnect(evt) {
         this._running = false;
-        this._disconnected(rfb, clean, this._frame_index);
+        this._disconnected(evt.detail.clean, this._frame_index);
     }
 };
index 66f4057654b5ecaa641c228614a131412f4e8816..d5f9442806d8c409282fb4fa2a0c0570996a5eab 100644 (file)
@@ -26,9 +26,6 @@
                     <td><div id="VNC_status">Loading</div></td>
                 </tr></table>
             </div>
-            <canvas id="VNC_canvas" width="640px" height="20px">
-                Canvas not supported.
-            </canvas>
         </div>
 
     </body>