cordova-plugin-presentation icon indicating copy to clipboard operation
cordova-plugin-presentation copied to clipboard

Automatically use first available display instead of letting user choose

Open Montoya opened this issue 9 years ago • 9 comments

Hi, I have been using the following plugin to support external displays on iOS:

https://github.com/pearj/ExternalScreen-iOS

With that plugin, when an external display becomes available you just launch your HTML file and it shows up. It doesn't give you the option to choose an external display. I like this approach because I assume the user will only connect 1 external display and I'd like to skip the step of having them choose.

I want to use cordova-plugin-presentation since it supports Android as well, but I'm wondering if it would be possible to emulate the 'skip choosing and go straight to displaying' feature?

Montoya avatar May 13 '15 21:05 Montoya

Hi, in fact that's an interesting request. Since the W3C Presentation API has evolved and still is that might be another input for discussion. Many of the participants/contributors of the API will meet next week f2f so at latest we will discuss this CR then. On the other hand, the display selection list shouldn't stay with one item in future. There should appear all kinds of accessible displays via a broad range of technologies, e.g. DIAL/HbbTV. But what is thinkable regarding the cordova-plugin-presentation is an option like {autoConnectFirstDisplay: true} which would meet your requirement. Wdyt? BR

mlasak avatar May 14 '15 06:05 mlasak

{autoConnectFirstDisplay: true} sounds great. So basically it would be the same call, requestSession, but by passing this option it would just select the first available display and no selection list would be shown.

Also, another crazy idea: auto connect all available displays and mirror across all of them. So a multi-external display scenario where you want to show the same content on all external displays (like when you have two projectors, one on each side of the room). So maybe something like {autoConnectFirstDisplay:true, mirrorAllDisplays:true}

Montoya avatar May 14 '15 17:05 Montoya

I wouldn't call your idea crazy ;) It is just unrealistic as long as it remains limited on iOS to stream video to one AirPlay device at the same time. But when they change this someday we will allow for mirroring to multiple screens from this plugin. BR

mlasak avatar May 15 '15 07:05 mlasak

Any word on this?

Montoya avatar Jun 03 '15 11:06 Montoya

Bump.

Montoya avatar Jun 10 '15 02:06 Montoya

@mlasak and what about Android? In the Android Presentation API, it's mentioned that output to multiple monitors is already possible:

"See also the {@link PresentationActivity} sample which uses the low-level display manager to enumerate displays and to show multiple simultaneous presentations on different displays."

Has this been integrated in the Cordova plugin?

cortopy avatar Jun 20 '16 23:06 cortopy

@cortopy FYI: The W3C Presentation (https://www.w3.org/TR/presentation-api/) will become a Recommendation soon (end of the year) and we will then publish a new version of the plugin that is fully compatible with the new version which also bring some new features which are not supported in the current version which implements an older version of the Presentation API Specification (https://www.w3.org/2014/secondscreen/presentation-api/20140721/).

louaybassbouss avatar Sep 23 '16 08:09 louaybassbouss

Looks like one of the forked repos implemented auto screen selection:

https://github.com/meirsadan/cordova-plugin-presentation/commit/4b564bbe34b7c8ea6a542b065df6e8f8337dc347

@louaybassbouss Are you still working on this?

iwoj avatar Jan 06 '18 20:01 iwoj

In my case, I just need the android platform. So, what I did is tweak a little bit to "silent" the dialog and choose the "second" screen by default.

zhangv avatar Aug 17 '24 08:08 zhangv