W3C home > Mailing lists > Public > public-secondscreen@w3.org > May 2015

Re: Rethinking availability monitoring

From: Mounir Lamouri <mlamouri@google.com>
Date: Mon, 04 May 2015 15:05:44 +0000
Message-ID: <CA+-LeH9EZc67wXkLHpbmRpZgpYVeLVEcJXnN0wUULKTfd=KTcw@mail.gmail.com>
To: "Kostiainen, Anssi" <anssi.kostiainen@intel.com>, Anton Vayvod <avayvod@google.com>
Cc: "mark a. foltz" <mfoltz@google.com>, "public-secondscreen@w3.org" <public-secondscreen@w3.org>
I think that Anton's proposal would be a great benefit over the current
model.

I am tempted to do some bikeshedding too but I will leave that to editors
and implementors ;). Though, I think that at least listenForAvailability()
should be renamed to to getAvailability() or availability().

-- Mounir

On Mon, 27 Apr 2015 at 16:31 Kostiainen, Anssi <anssi.kostiainen@intel.com>
wrote:

> Hi Anton,
>
> > On 25 Apr 2015, at 22:03, Anton Vayvod <avayvod@google.com> wrote:
> >
> > Having discussed this with Mounir recently, the right approach would be
> to return an object via Promise that has a bool and an event handler. This
> way the UA doesn't have to do weird tricks like detect if anything is
> subscribed to the event to start/stop discovery, there's no compromise
> between the attribute being initialized or firing the event immediately
> after a listener is attached and even gives more flexibility if the page
> wants to filter the events - pass the parameters to the Promise returning
> method.
> >
> > partial interface NavigatorPresentation {
> >   Promise<AvailabilityListener> listenForAvailability(/*DOMString
> presentationUrl, params*/);
> > }
> >
> > interface AvailabilityListener : EventTarget {
> >   readonly attribute boolean available;
> >   attribute EventHandler onavailablechange;
> > }
> >
> > One may need some way to discard the listener to signal the UA that the
> page is not interested in the screens anymore.
> >
> > WDYT?
>
> Thanks, this looks good to me, perhaps with some bikeshedding about naming
> :-)
>
> We've used a similar design in other specs, for example:
>
> * Battery Status API (http://www.w3.org/TR/battery-status/)
> * Permissions API (https://w3c.github.io/permissions/)
>
> ... so this has proven to work and is implementable.
>
> Thanks,
>
> -Anssi (WG chair)
Received on Friday, 8 May 2015 02:25:04 UTC

This archive was generated by hypermail 2.3.1 : Friday, 8 May 2015 02:25:05 UTC