I have code in phonegap. What I'm trying to do is when the video is finished playing, it will call the window.open function in phonegap and redirect it to another page.
2 回答
0
您可以通过使用 architectsdk:// 来实现这一点。
在创建维基世界之前,首先通过app.wikitudePlugin.setOnUrlInvokeCallback设置一个监听器。
var app = { // Define other functions like device onDeviceReady, onDeviceNotSupportedCallback // Add a listener before creating world onDeviceSupportedCallback: function() { //Set listener app.wikitudePlugin.setOnUrlInvokeCallback(app.onURLInvoked); // Create the world WikitudePlugin.loadARchitectWorld("www/world.html"); }, // This listener will be invoked everytime you call document.location = architectsdk://.. in ARchitectWorld onURLInvoked: function(url) { var scheme = 'architectsdk://'; if (url.search(scheme) === 0) { // Remove architectsdk://from string and evaluate function var func = decodeURIComponent(url.substr(scheme.length)); eval(func); } },
};
然后使用document.location = architectsdk://调用监听器
$('a').click(function() { var func = encodeURIComponent("window.open('"+this.href+"','_system');"); document.location = "architectsdk://" + func; return false;
});
于 2014-05-28T18:08:51.167 回答
0
尽管基于 JS 的 Wikiitude 的 AR-View 也与 PhoneGap 功能隔离。您可以定义 urlListeners 来在 PhoneGap 和 AR-View 之间进行交互,但是没有办法将 Wikitude 和 PhoneGap 的 JavaScript 功能组合到一个 html/js 文件中。
亲切的问候。
在此处查找有关 PhoneGap 和增强现实的详细信息 http://www.wikitude.com/developer/documentation
于 2014-03-06T15:09:38.667 回答