1
votes

I am working on a basic Vuforia app following their documentation and i am new to Unity 3D.

I am working on to play videos in vuforia when the image target is detected. I got the videos playing but when it comes to multiple target, multiple videos are played as per the vuforia's behaviour.

But i want to play only one video at a time even multiple image targets are focused. Looking forward for some help to learn.

I am just using the vuforia's video playback script to play the videos.

2
Your requirement is not very clear - it is clear what you do not want. But play one at a time how? What do you expect if I now have a target with video playing, and another target comes in? BTW, it seems to be that this is something that you should manage in your code according to your logic, and it has nothing to do with Vuforiayakobom

2 Answers

0
votes

This is fairly simple in unity. You have append those videos to their respective Image Target. I hope you have done so. You can get the video inside OnTrackableStateChanged by following:

vidPlay = mTrackableBehaviour.GetComponentInChildren<VideoPlayer>();

where vidplay is a VideoPlayer component declared inside DefaultTrackableEventHandler class. now play it once the target image is detected. like this: vidPlay.Play(); or vidPlay.Pause();. I hope this helps! Thank You.

0
votes

You can see a option called as 'Max Simultaneous Image Targets' in Unity Inspector under Vuforia Configuration. Just mention how many targets you need to track simulataneously at a time and Vuforia will take care of other stuffs.

I set the count as '1' and one image target is tracked at a time.