From 4c27e44ef8b2eff3f419be7cea694e8380b39070 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Wed, 20 Jun 2012 07:41:59 -0700 Subject: [PATCH] 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. --- rlgterm.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rlgterm.js b/rlgterm.js index 6140b4d..704bc9e 100644 --- a/rlgterm.js +++ b/rlgterm.js @@ -27,13 +27,20 @@ var ajaxstate = { this.set(4000); this.state++; } - else if (this.state < 8) { - this.set(15000); - this.state++; + else if (session.playing) { + if (this.state < 8) { + this.set(15000); + this.state++; + } + else { + /* It's been over a minute. Stop polling. */ + this.clear(); + } } else { - /* It's been over a minute. Stop polling. */ - this.clear(); + /* 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) {