PhoneGap/Cordova ExternalScreen 插件声明 "External Web View unavailable"
PhoneGap/Cordova ExternalScreen plugin states "External Web View unavailable"
我为 iPad 创建了一个 PhoneGap/Cordova 应用程序,我想通过 AirPlay 将应用程序中的特定图像共享到第二个屏幕(PC 或 Mac 运行 AirServer(参见 http://www.airserver.com))。
所以我安装了 PhoneGap 插件 "ExternalScreen":
网站:
http://www.tricedesigns.com/2012/01/12/multi-screen-ios-apps-with-phonegap/
Github: https://github.com/triceam/phonegap-plugins/tree/master/iPhone/ExternalScreen
所以在我的应用程序中,我调用了以下代码以查看它是否有效(AirPlay 已经连接到 AirServer 并且镜像已打开。我可以在我的 AirServer 实例上看到 iPad 的屏幕内容):
PGExternalScreen.loadHTML('HELLO', function(e){
alert(e);
}, function(){
alert(e);
});
上面的代码将始终警告“外部 Web 视图不可用”。
但有趣的是,下面的代码会提示'available':
PGExternalScreen.checkExternalScreenAvailable(function(){
alert('available');
}, function(){
alert('not available');
});
怎么了?
好的,我找到了这个问题的原因。我忘了调用它来初始化
PGExternalScreen.setupScreenConnectionNotificationHandlers(success, fail);
RTFM,我猜:-(
我为 iPad 创建了一个 PhoneGap/Cordova 应用程序,我想通过 AirPlay 将应用程序中的特定图像共享到第二个屏幕(PC 或 Mac 运行 AirServer(参见 http://www.airserver.com))。
所以我安装了 PhoneGap 插件 "ExternalScreen":
网站: http://www.tricedesigns.com/2012/01/12/multi-screen-ios-apps-with-phonegap/
Github: https://github.com/triceam/phonegap-plugins/tree/master/iPhone/ExternalScreen
所以在我的应用程序中,我调用了以下代码以查看它是否有效(AirPlay 已经连接到 AirServer 并且镜像已打开。我可以在我的 AirServer 实例上看到 iPad 的屏幕内容):
PGExternalScreen.loadHTML('HELLO', function(e){
alert(e);
}, function(){
alert(e);
});
上面的代码将始终警告“外部 Web 视图不可用”。
但有趣的是,下面的代码会提示'available':
PGExternalScreen.checkExternalScreenAvailable(function(){
alert('available');
}, function(){
alert('not available');
});
怎么了?
好的,我找到了这个问题的原因。我忘了调用它来初始化
PGExternalScreen.setupScreenConnectionNotificationHandlers(success, fail);
RTFM,我猜:-(