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:
parent
674f570b63
commit
4c27e44ef8
1 changed files with 12 additions and 5 deletions
|
|
@ -27,7 +27,8 @@ var ajaxstate = {
|
|||
this.set(4000);
|
||||
this.state++;
|
||||
}
|
||||
else if (this.state < 8) {
|
||||
else if (session.playing) {
|
||||
if (this.state < 8) {
|
||||
this.set(15000);
|
||||
this.state++;
|
||||
}
|
||||
|
|
@ -35,6 +36,12 @@ var ajaxstate = {
|
|||
/* It's been over a minute. Stop polling. */
|
||||
this.clear();
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* If watching, it can't stop polling entirely, because there
|
||||
* are no POST events to start it up again. */
|
||||
this.set(10000);
|
||||
}
|
||||
},
|
||||
posted: function (wasdata) {
|
||||
if (wasdata) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue