Timo Ernst
Timo Ernst

Reputation: 15983

PhoneGap/Cordova ExternalScreen plugin states "External Web View unavailable"

I created a PhoneGap/Cordova app for iPad and I want to share specific images from the app via AirPlay to a second screen (A PC or Mac running AirServer (see http://www.airserver.com)).

So I installed the PhoneGap plugin "ExternalScreen":

So within my app I called the following code to see if it works (AirPlay is already connected to AirServer and mirroring is on. I can see the screen content of the iPad on my AirServer instance):

PGExternalScreen.loadHTML('HELLO', function(e){
    alert(e);
}, function(){
    alert(e);
});

The code above will always alert 'External Web View Unavailable'.

But the funny thing is, the following code will alert 'available':

PGExternalScreen.checkExternalScreenAvailable(function(){
    alert('available');
}, function(){
    alert('not available');
});

What's wrong?

Upvotes: 0

Views: 290

Answers (1)

Timo Ernst
Timo Ernst

Reputation: 15983

Ok, I found the reason for this problem. I forgot to call this to initialize

PGExternalScreen.setupScreenConnectionNotificationHandlers(success, fail);

RTFM, I guess :-(

Upvotes: 0

Related Questions