cordova-plugin-presentation
cordova-plugin-presentation copied to clipboard
Automatically use first available display instead of letting user choose
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?
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
{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}
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
Any word on this?
Bump.
@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 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/).
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?
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.