Renz Salanga
Renz Salanga

Reputation: 489

Wikitude cordova plugin camera black screen showing only Trial word(Javascript)

Hello everyone i've been stuck for the whole day trying to figure out why is the camera view not showing. It only shows black with the world trial.

Its supposed to be showing the camera live feed along with the watermarks trial here is the documentation

Wikitude Cordova Plugin Reference

Here is a screen shot

Image one, Image two

index.html

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <script src="https://www.wikitude.com/libs/architect.js"></script>
    <title>Hello World</title>
</head>
<body>


    <button style="width: 50%; margin-top: 50%; margin-left: 25%; font-size:50px" id="cam">Start Augmented</button>
    <button style="width: 50%; margin-top: 55%; margin-left: 25%; font-size:50px" id="clo">Close</button>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>
</html>

index.js

var wikitudePlugin;
$(document).on('deviceready',function(){
    wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
    var requiredFeatures = [ "2d_tracking", "geo" ];
    var arExperienceUrl = "www/index.html";
    var startupConfiguration = { "camera_position": "back"};

    $('#cam').click(function(){
        wikitudePlugin.isDeviceSupported(function(){
            wikitudePlugin.loadARchitectWorld(
            function(url){
                alert("Success");
                wikitudePlugin.show();
            },
            function(err){
                alert("Error"+err);
            },
            arExperienceUrl,
            requiredFeatures,
            startupConfiguration
            );
        },
        function(){
            alert("Not Supported and cp mo bulok haha");
        },
        requiredFeatures);
    });

    $('#clo').click(function(){
        wikitudePlugin.hide();
    });
});

$(document).on('pause',function(){
   wikitudePlugin.onPause();
});

$(document).on('resume',function(){
  wikitudePlugin.onResume();
});

$(document).on('backbutton',function(){
  wikitudePlugin.onBackButton();
});

Upvotes: 0

Views: 191

Answers (1)

Daniel
Daniel

Reputation: 26

Since the trial watermark is being rendered correctly the Wikitude SDK seems to be running. My guess is that your app does not have permission to access the camera.

If that should not be the case, I'd prefer to continue this conversation in the Wikitude forums. SO does not seem to me to be the best place for remote debugging an issue such as this.

https://support.wikitude.com/support/home

Upvotes: 0

Related Questions