comparison rlgterm.js @ 63:a077f9f84052

RLG-Web client: adjust polling for watching. The ajaxterm state machine assumed data appears in response to user actions, which is not true when watching. It now uses different sets of parameters for playing and watching.
author John "Elwin" Edwards <elwin@sdf.org>
date Wed, 20 Jun 2012 07:41:59 -0700
parents 071ec6b1ec03
children e3082fd06520
comparison
equal deleted inserted replaced
62:7793ad53b90f 63:a077f9f84052
25 } 25 }
26 else if (this.state < 4) { 26 else if (this.state < 4) {
27 this.set(4000); 27 this.set(4000);
28 this.state++; 28 this.state++;
29 } 29 }
30 else if (this.state < 8) { 30 else if (session.playing) {
31 this.set(15000); 31 if (this.state < 8) {
32 this.state++; 32 this.set(15000);
33 this.state++;
34 }
35 else {
36 /* It's been over a minute. Stop polling. */
37 this.clear();
38 }
33 } 39 }
34 else { 40 else {
35 /* It's been over a minute. Stop polling. */ 41 /* If watching, it can't stop polling entirely, because there
36 this.clear(); 42 * are no POST events to start it up again. */
43 this.set(10000);
37 } 44 }
38 }, 45 },
39 posted: function (wasdata) { 46 posted: function (wasdata) {
40 if (wasdata) { 47 if (wasdata) {
41 this.set(1000); 48 this.set(1000);