- From: mark a. foltz <mfoltz@google.com>
- Date: Mon, 8 Sep 2014 15:52:51 -0700
- To: "Rottsches, Dominik" <dominik.rottsches@intel.com>
- Cc: "avayvod@google.com" <avayvod@google.com>, "Kostiainen, Anssi" <anssi.kostiainen@intel.com>, "public-webscreens@w3.org" <public-webscreens@w3.org>
- Message-ID: <CALgg+HHr9xVht9sC-sB=7MRJytq=XRynx5T8W2s7s_Vw1ueoQw@mail.gmail.com>
Anton, When you mention "other Web APIs", I assume you're talking about cases like the WebSocket API [1] where the page can construct a WebSocket object and add a handler to onreadystatechange before yielding execution. This way there's no ambiguity between the property (readyState) and the event (readystatechange). For the Presentation API, it's not clear what the initial value of the property would be - we would have either leave it |null| or add an "unknown" state. And the page would probably assume that no screens were available until it got an availablechange event telling it otherwise. So the property seems redundant, but maybe you can elaborate on: "We want, however, to avoid firing the event immediately with e.available = true in case the UA already discovered some devices." Since I think that's exactly what we would want to do to minimize the amount of time the user is unable to start presentation after page load. m. On Fri, Sep 5, 2014 at 7:11 AM, Rottsches, Dominik < dominik.rottsches@intel.com> wrote: > Hi Anton, > > On Fri, 2014-09-05 at 12:37 +0100, Anton Vayvod wrote: > > We all agreed that the |onavaiablechange| event handler is the only > > way to handle the fact that the device availability changes over time > > otherwise we'd use a Promise for one time check. So we should assume > > the page will add a handler to the |onavailablechange| as soon as it > > wants to present something. We want, however, to avoid firing the > > event immediately with e.available = true in case the UA already > > discovered some devices. AFAIK, just because it's inconsistent with > > all other event handlers. > > > > How would you see an async getter work along with the event handler? > > Would the page get both the event from the event handler and an async > > callback from the getter if the UA only started the discovery when the > > event handler was added? I don't think we want to pass the same result > > to the page twice. > > Agree with the summary - and not an easy question - I don't have an > immediate answer, I think I need to research whether we can find a > previously used paradigm from other Web APIs for this. > > Regarding your suggestion to have a cached "available" flag alongside - > that would indeed be potentially confusing. If possible, let's try to > avoid redundancy. > > Dominik > >
Received on Monday, 8 September 2014 22:53:39 UTC