Log in or register to post comments

AR - When Tracking is lost, video keeps playing

December 2, 2017 - 3:38pm #1

I created my imageTarget with my AR camera. On my imageTarget I have a plane with a videoPlayer attached to it.

When I run it, even before I can establish TrackingFound, the video starts playing but I can't see it. When I establish TrackingFound, the video shows up. When TrackingLost, video keeps playing. It will loop if I have that checked and it would loop endlessly even though I have TrackingLost.

Here's what I'm trying to do:

I would like to activate an imageTarget and show a video. When TrackingLost(), pause video for 2f. If Tracking found, resume video, else TrackingFound, reset video to 0f. If TrackingLost() is > 2f, stop video and reset to 0f.

The DefaultTrackableEventHandler.cs that is attached to the image target has no way to control the videoPlayer. I would expect that this would be built in because it works for everything else other than video.

I am using:

Unity 2017.2.0f3 (64-bit) with Vuforia 6.5

Please Help. I've been working on this for 3 weeks straight. I am new to Unity and Vuforia and I am a newbie to C#.

If you need more from me please let me know.

Thanks

D

AR - When Tracking is lost, video keeps playing

December 4, 2017 - 11:37am #3

Hello damiandesign,

Have you looked at our Core Samples project on the Unity Asset Store? The Image Target scene has an example of displaying a video on top of a detected Image Target. This video will display over the target and begin playing when you tap the play button. It will pause when tracking is lost and will remain on the paused frame when tracking is found again. Using this as a starting point, you should be able to create the functionality you are looking for.

Thanks,

Vuforia Support

AR - When Tracking is lost, video keeps playing

December 4, 2017 - 8:10am #2

ADDED for clarity. Sorry if I confused anyone. Let me make sure I'm clear.

If anyone of us are using video as a Augmented GameObject for an imageTarget, these are the natural functions we would need for our video to work properly as a Augmented GameObject.

1. The video will start playing when imageTarget has found Tracking.

2. When you lose Tracking for a short amount of time(3F), video will pause. If you return and find Tracking within set time(3F) the video will resume.

3. If you lose Tracking for more than the stated time(3F), the video will stop. If it has been longer than set time(3f), when you find Tracking again, video would have reset to (0f) and start playing from beginning.

That would be a perfect starter script for working with the videoPlayer in AR.

I am using:

Unity 2017.2.0f3 (64-bit) with Vuforia 6.5

Please Help. I've been working on this for 3 weeks straight. I am new to Unity and Vuforia and I am a newbie to C#.

If you need more from me please let me know.

Thanks

D

Log in or register to post comments