Start a new topic

autotrigger action when IR

autotrigger action when IR

Hi,

I just want to execute an action (video player) when an trackable object is shown to the user. Is there any way to do this ?

With this line of code, the trigger is fire when the object is loaded but not when it is displayed :

var tracableObject = new AR.Trackable2DObject(logoTracker, "imageID", { drawables: { cam: imageOverlay }, triggers: {onEnterFieldOfVision: playMovie}});

function playMovie()
{
        var url = "http://www.wikitude.com/doc/tutorial/Serie3.m4v";       
        AR.context.startVideoPlayer(url);
}


Thanks.
Hi,

the onEnterFieldOfVision trigger is the correct trigger to use. Can you test if the trigger is called correctly for you using e.g. AR.logger.info(). I would be interested if the trigger fires only at loading or would fire correctly afterwards as well.

FYI, as of 1.1 the trigger object is deprecated and all triggers can be used accessed directly as object properties e.g. new AR.Trackable2DObject(logoTracker, "imageID", { drawables: { cam: imageOverlay }, onEnterFieldOfVision: playMovie});
Hi,

Thanks, direct access solve it :AR.Trackable2DObject(logoTracker, "imageID", { drawables: { cam: imageOverlay }, onEnterFieldOfVision: playMovie});
Unfortunately, there's still one issue when I close the movie player (selecting "Done" button). Application freezes, after blinking, with differents messages like :

libGPUSupportMercury.dylib`gpus_ReturnUnexpectedKillClient:
Many times, the movie player is closed automatically, few second after starting
Great to hear that the trigger works.

We will look into the startvideo player problem and I'll get back to you once I know more.
Hi,

One update :
Many times, the movie player is closed automatically, few second after starting
This is caused by "masterAnimationGroup.start(-1);"  because the object was not instantiate when this method was called... so I fixed it.

But the crash when the movieplayer ends is still there.


regards.
Hi,
We will look into the startvideo player problem and I'll get back to you once I know more.
This is how I use the video player:

function createTracker()
{
var horseImageResource = new AR.ImageResource("horse.png", {onError: error});
var horseImageDrawable = new AR.ImageDrawable(horseImageResource, 1.0, {zOrder: 0});
// create tracker trackerDataSetPath = "Tracktable.zip";tracker = new AR.Tracker(trackerDataSetPath, { onLoaded : trackerLoaded, onError: error });
AllTrackable2DObjects = new AR.Trackable2DObject(tracker, "horse", { drawables: { cam: horseImageDrawable }, onEnterFieldOfVision: showHorseVideo});
}

function showHorseVideo()
{
AR.context.startVideoPlayer("horse.mp4");
}




Loading ...

createTracker();



Do I need to add anything else ?

thanks.
Hi,

just want to let you know that we found the issue and that it will be fixed in the next maintenance update. If you have an urgent buisness need that requires the fix please send us an email at info@wikitude.com.

Hi,

 

When did you plan to release the fix ?

 

Thanks.

Hi,

you can expect the Maintenance update in the next 2 weeks.

I am also getting the same error. Can you please let me know that the fix for this has been released?

Hi,

this issue has been fixed since a couple of versions. What SDK version are you using and can you please describe your problem in detail? 

Thanks

Thanks for the response. Previously I was using 3.1 version, now I have upgraded to 3.2 and works fine.

And I need one more help. Can you help me how to play the video in full screen using VideoDrawable API? I have looked at the documentation, and I cpuld not find the details. 

If you want to play it full screen, you should use the AR.context.startVideoPlayer() function. VideoDrawables will (on supported devices) always be overlaid on top of the target image or displayed as part of a GeoObject.
Login or Signup to post a comment