-1

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.

Nathan Monteleone
  • 5,430
  • 29
  • 43

2 Answers2

0

Although also JS based Wikitude's AR-View is isolated from the PhoneGap features. You may define urlListeners to interact between PhoneGap and AR-View, but there is no way to combine Wikitude's and PhoneGap's JavaScript features in one html/js file.

Kind regards.

Find details around PhoneGap and Augmented Reality here http://www.wikitude.com/developer/documentation

Andi F.
  • 717
  • 5
  • 7
0

You can achieve this by using architectsdk://.

  • First set a listener via app.wikitudePlugin.setOnUrlInvokeCallback before creating wikitude world.

    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);
        }       
    },    
    

    };

  • Then call listener with document.location = architectsdk://

    $('a').click(function() {
    var func = encodeURIComponent("window.open('"+this.href+"','_system');");
    document.location = "architectsdk://" + func;
    return false;
    

    });

hknkrt
  • 96
  • 4