Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NotFoundError when prompt() is called and availability monitoring is not available optional #65

Closed
avayvod opened this issue Nov 5, 2016 · 5 comments

Comments

@avayvod
Copy link
Contributor

avayvod commented Nov 5, 2016

The step 8 from the prompt() algorithm was inspired by the similar step (10.2) in the Presentation API's PresentationRequest.start() algorithm.

This step seems problematic to implement when the availability monitoring is not supported by the device. At least on Android the device picker dialog will not hide until user closes it even if devices are not found. Closing the dialog by the browser would be against the current guidelines of using it I assume.

I propose making this step optional.

@mfoltzgoogle - I'm not sure how this works with the Presentation API on desktop (I think on Android it is not supported as well).

@markafoltz
Copy link
Contributor

I believe this step is to handle when the user agent has disabled device discovery in a way that won't change over the lifetime of the call to prompt(), so the user agent would have no reason to show a dialog anyway. I don't think we handle this specifically on Chrome for desktop and always show the dialog.

@mounirlamouri
Copy link
Member

My understanding of step 8 is that the user agent should reject immediately if it knows that the dialog will show no devices. However, the case you present is different because we need to show the dialog and do the discovery and then realize there is nothing.

Is my understanding correct?

@avayvod
Copy link
Contributor Author

avayvod commented Nov 11, 2016

Yes, I'm thinking about the case when the background availability monitoring is not available and we have to show the dialog to start active device discovery. We could argue that there's no timeout in this case as user could turn on a device at any moment.

@mounirlamouri
Copy link
Member

In the case you describe, prompt() would hang while the dialog is visible and the state will stay disconnected which is all fine, right? If the user picks a device, it would switch the state to connecting and resolve the promise. Otherwise, it would reject the promise with NotAllowedError, right?

@avayvod
Copy link
Contributor Author

avayvod commented Nov 16, 2016

Ok, one can argue that in the use case I describe above the UA doesn't know if the "list of available remote playback devices..." "...will remain so [empty] before the request for user permission is completed" which makes the step a no-op.

@avayvod avayvod closed this as completed Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants