Log in or register to post comments

Autoplay video in Vuforia core samples

January 22, 2018 - 3:04am #1

Hello,

I'm trying to let a video play on a target image, the video should play as soon as the target is found.

I'm using vuforia's ImageTarget samples. I want the video to play automatically when the target is found, not by pressing the play button.

Thanks for your help.

 

 

 

Autoplay video in Vuforia core samples

February 14, 2019 - 2:45pm #7

I am having the exact same issue when using the Video Player on a Quad. It's been driving me nuts for the past week. The video automatically starts playing once the Play button is pressed. I want the video to only play when the target image is found. 

When running the app on my iPhone, the video automatically starts once the app start. Definitely not how it should be. I've tested a ton of different settings and still no luck. Simply turning on or off Play on Awake, is doing the trick. Can you please explain what exactly this means. "removing the button logic from the sample". Any help is greatly appreciated.

 

Autoplay video in Vuforia core samples

January 24, 2018 - 4:48am #6

Hello shengen,

I found a way to do it.

To set the video to be active initially you have to select the video game object, and under the inspector in video player make sure "play on awake" is checked.

Then select the image target, and open the video trackable event handler script, there you have to add the OnTrackingFound() method.

It should look like this:

 

public class VideoTrackableEventHandler : DefaultTrackableEventHandler

{

    #region PROTECTED_METHODS

    protected override void OnTrackingFound()

    {

        mTrackableBehaviour.GetComponentInChildren<VideoController>().Play();

        base.OnTrackingFound();

    }

    protected override void OnTrackingLost()

    {

        mTrackableBehaviour.GetComponentInChildren<VideoController>().Stop();

        base.OnTrackingLost();

    }

    #endregion // PROTECTED_METHODS

}

Autoplay video in Vuforia core samples

January 23, 2018 - 11:30am #5

how do i set it to active?

Autoplay video in Vuforia core samples

January 23, 2018 - 10:12am #4

Hello again,

Is your video object set to be active initially? The video might start playing automatically if that's the case.

Thanks,

Vuforia Support

Autoplay video in Vuforia core samples

January 22, 2018 - 10:25am #3

Hello, 

Thank you for the prompt reply.

I've done that, but this plays the video only one time directly after the app is started, not when the target is found.

So if I start the app and wait a short time before showing my target, and then show my target to the camera, the video appears on it already at its last frame. 

What I want is the video to start playing on the target only once the target is detected. If I cover the target and then show it again, the video should not be staying on its last frame but start over from the beginning.

I hope you understand what I mean.

Thank you in advance

Autoplay video in Vuforia core samples

January 22, 2018 - 9:27am #2

Hello Ballenazul,

I'd recommend removing the button logic from the sample and enabling Play on Awake on the video player. This will allow you to have the video immediately play upon detection.

Thanks,

Vuforia Support

Log in or register to post comments