You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are already connected screens when the page subscribes to the onavailablechange event, we can handle this in two ways: We can synthesize one initial event to notify the page about available screens as soon as the first event handler is installed (as described). Or we can add another message like navigator.presentation.getAvailable(function(available) { } ); to notify the page about available screens using this one-time asynchronous getter. Which way should we go?
The algorithm in the current specification is defined in terms of an event based approach, and according to the Promises Guide it's appropriate when there may be multiple results from one asynchronous getter.
We may reopen this when the Streams API become more fully defined.
I think the current events based approach [1] is a better fit for conveying the availability information in the Presentation API, since the data involved is not large. The relevant Promises Guide section is Recurring Events [2].
An example of an API that builds upon the Streams API is e.g. TCP and UDP Socket API [3]. This API potentially produces large amounts of data and as such is a good fit for Streams API.
From http://webscreens.github.io/presentation-api/#open-questions:
If there are already connected screens when the page subscribes to the onavailablechange event, we can handle this in two ways: We can synthesize one initial event to notify the page about available screens as soon as the first event handler is installed (as described). Or we can add another message like navigator.presentation.getAvailable(function(available) { } ); to notify the page about available screens using this one-time asynchronous getter. Which way should we go?
Also see: https://github.com/webscreens/presentation-api/issues/8
The text was updated successfully, but these errors were encountered: