GoogleChrome / samples

A repo containing samples tied to new functionality in each release of Google Chrome.
https://www.chromestatus.com/samples
Apache License 2.0
5.77k stars 2.38k forks source link

Presentation API sample from Android Chrome #577

Open stuartlangridge opened 6 years ago

stuartlangridge commented 6 years ago

Is the Presentation API sample intended to work on Android Chrome? On desktop Chrome it pops up the Google Cast extension, but on Android I get "no screens found". Secondarily, if it should work on Android, how does Android know about a second screen? I've got an Amazon Fire Stick and an ezCast device here, as well as miracast software running on a server; is there some specific thing those devices need to advertise so that the Presentation API stuff in Chrome notices that they exist and offers them as a target?

(I think this might be a @beaufortfrancois question, although of course I'm happy to hear from anybody :-))

beaufortfrancois commented 6 years ago

Sadly Android is not supported for now for attached displays.

The article at https://developers.google.com/web/updates/2018/04/present-web-pages-to-secondary-attached-displays#whats_next says:

As of Chrome 66, Chrome OS, Linux, and Windows platforms are supported. Mac support will come later.

beaufortfrancois commented 6 years ago

For info, the Presentation API can be implemented in one of two ways. See https://w3c.github.io/presentation-api/#introduction for an overview.

1-UA mode: The same browser renders the URL and figures out a way to send the output to a wired/wireless display. The display just renders an audio/video stream. This is what is implemented in Chrome desktop today. It works for all supported screen types.

2-UA mode: Just the URL is sent to the display and it is responsible for rendering. This is implemented for Chrome in both desktop and Android, but only for URLs that correspond to Cast applications which are then launched on Cast devices.

See https://googlechrome.github.io/samples/presentation-api/cast for an example of cast URL.

Regelink commented 4 years ago

Unfortunately https://googlechrome.github.io/samples/presentation-api/cast doesn't seem to work for me (either from Chrome desktop or Android Chrome). I would expect to see a '> Connected to ...' in the Live Output after I press the 'presentationRequest.start()' button, but it doesn't seem to connect. My Cast device does show the "Hello World!" screen though...