Re: [presentation-api] Rethinking availability monitoring

Rather than add a `cancel` method we could write the 
`AvailabilityListener` API as follows:

```
partial interface NavigatorPresentation {
  AvailabilityListener listenForAvailability(/*DOMString 
presentationUrl,
      params*/);
}

interface AvailabilityListener : EventTarget {
  Promise<boolean> getAvailability();
  attribute EventHandler onavailablechange;
}
```

The UA would not run discovery if:

* there were no handlers on `onavailablechange`
* there was no unresolved `Promise` from `getAvailability`

Even if there were listeners, the UA could also suspend discovery if 
there was no opportunity to start presentation (i.e., screen was off, 
tab was in the background, etc.) as a power optimization.

I would like to understand the role of the `presentationUrl` and 
`params` in the API; @avayvod, they were part of your original 
proposal.





-- 
GitHub Notif of comment by mfoltzgoogle
See 
https://github.com/w3c/presentation-api/issues/81#issuecomment-101039366

Received on Monday, 11 May 2015 20:31:20 UTC