By JonnyR
on Fri, 11/29/2013 - 12:28
So I'm using the VideoPlayback sample code and am trying to get a custom video to play when a Image Target is tracked. The target is tracked and a video is played on it, but unfortunately it isn't my custom video but one from the samples. What I did was the following:
EAGLView.h:
#define NUM_VIDEO_TARGETS 3 #define NUM_AUGMENTATION_TEXTURES 6
EAGLView.mm
const char* textureFilenames[NUM_AUGMENTATION_TEXTURES] = { "icon_play.png", "icon_loading.png", "icon_error.png", "VuforiaSizzleReel_1.png", "VuforiaSizzleReel_2.png", "test.png" };
-(void)renderFrameQCAR { [...] int playerIndex = 0; // stones if (strcmp(imageTarget.getName(), "stones") == 0) { playerIndex = 1; } else if (strcmp(imageTarget.getName(), "test") == 0) { playerIndex = 2; } [...]
VideoPlaybackAppDelegate.mm
- (void)applicationDidBecomeActive:(UIApplication *)application { [...] NSString* filename; switch (i) { case 0: filename = @"VuforiaSizzleReel_1.m4v"; break; case 2: filename = @"test.m4v"; default: filename = @"VuforiaSizzleReel_2.m4v"; break; } }
Could anybody pls tell me what i am missing here?
Thanks in advance
Custom Video Playback: still sample video plays
I think you just need to debug your code, and step through it in XCode to understand what you have done and why it is not working.
N
Custom Video Playback: still sample video plays
Yes, it was a very simple error: missed the break; after
Custom Video Playback: still sample video plays
Great to hear :)