"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Two targets, two videos

I'm looking over the sample code and trying to modify it slightly to allow it to use two targets. I started with the easy part, making a new target and putting the XLM and DAT into my project, then modified the loader thus:

- (bool) doLoadTrackersData {

    bool ret = true;

    ret= [self loadAndActivateImageTrackerDataSet:@"Direct_mail_flier.xml"];

    ret= [self loadAndActivateImageTrackerDataSet:@"Sirens.xml"];

    return ret;

}

 But now I don't understand the next part... how do I select the right video based on the target? The sample starts the load/play in: 

- (void) prepare {

[...]

    for (int i = 0; i < NUM_VIDEO_TARGETS; ++i) {

        NSString* filename = @"Behind_The_Scenes.mp4";

        if (NO == [player load:filename playImmediately:NO fromPosition:videoPlaybackTime[i]]) {

            NSLog(@"Failed to load media");

        }

    }

But there's no selection based on the target here. I'm sure it's simple, can someone offer a pointer?

MauryMarkowitz

Fri, 09/05/2014 - 03:54

Ahhh. Look for this very key line of code:

        // VideoPlayerHelper to use for current target

MauryMarkowitz

Fri, 09/05/2014 - 03:57

This may dup, my appologies in advance.

The key code is VERY well hidden. Do a search in your project for: