- From: Anton Vayvod via GitHub <sysbot+gh@w3.org>
- Date: Wed, 29 Jun 2016 15:06:57 +0000
- To: public-secondscreen@w3.org
We simplified it a bit today in an offline discussion with Mounir:
```webidl
partial interface RemotePlayback {
// Registers a callback to get called with the availability for
the media element and its currently
// selected source for remote playback. The callback maybe called
immediately after the
// returned promise is resolved if the availability is already
known, the user agent
// may keep running the monitoring algorithm as long as there's at
least one callback registered
// and call all the callbacks with the new value when it changes.
// The promise is rejected if background monitoring is not
available. Otherwise it's fulfilled with an id
// that could be used to unregister the callback to save
resources.
Promise<long> watchAvailability(RemotePlaybackAvailabilityCallback
callback);
// Unregisters the callback with the specified id, or all
callbacks if the id is not specified.
// No-op if id is invalid.
void cancelWatchAvailability(optional long id);
};
// |available| is the new value that indicates if the devices are now
available or not.
callback RemotePlaybackAvailabilityCallback = void(boolean available);
```
--
GitHub Notification of comment by avayvod
Please view or discuss this issue at
https://github.com/w3c/remote-playback/issues/39#issuecomment-229386005
using your GitHub account
Received on Wednesday, 29 June 2016 15:07:04 UTC