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.
This commit is contained in:
John "Elwin" Edwards 2012-06-20 07:41:59 -07:00
parent 674f570b63
commit 4c27e44ef8

View file

@ -27,13 +27,20 @@ var ajaxstate = {
this.set(4000); this.set(4000);
this.state++; this.state++;
} }
else if (this.state < 8) { else if (session.playing) {
this.set(15000); if (this.state < 8) {
this.state++; this.set(15000);
this.state++;
}
else {
/* It's been over a minute. Stop polling. */
this.clear();
}
} }
else { else {
/* It's been over a minute. Stop polling. */ /* If watching, it can't stop polling entirely, because there
this.clear(); * are no POST events to start it up again. */
this.set(10000);
} }
}, },
posted: function (wasdata) { posted: function (wasdata) {